Skip to content

Custom Headers #11267

Closed
Closed
@ChakshuGautam

Description

@ChakshuGautam

Is your feature request related to a problem? Please describe

Adding custom headers similar to how it is done for any reverse proxy. An example would be adding custom auth headers when developing applications. An alternative is to have a reverse proxy (like an nginx) in front of the application but since Gitpod is already proxying requests, it is best suited to have it in the same layer.

Describe the behaviour you'd like

The feature should allow for

  1. Adding custom headers
  2. Removing/modifying default Gitpod headers (useful when setting a cookie header)

Adding a header to service for all requests to a service could be something like

# Commands to start on workspace startup
tasks:
  - init: yarn install
    command: yarn build
# Ports to expose on workspace startup
ports:
  - port: 8000
    onOpen: open-preview
    headers:
      - X-my-header my-header-content;

Here, headers expects an array. Adding a header that is already part of the Gitpod headers will lead to an updated header. I am not sure how the delete feature can work.

Additional context

Related Issues

  1. This issue was reported by myself on Discord [1].
  2. [ws-proxy] Add X-Forwarded-Port header #11110.

Metadata

Metadata

Assignees

No one assigned

    Labels

    meta: staleThis issue/PR is stale and will be closed soonteam: workspaceIssue belongs to the Workspace teamtype: feature requestNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions