Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev] Support request headers override in middleware #8752

Merged
merged 9 commits into from Oct 27, 2022

Conversation

nuta
Copy link
Contributor

@nuta nuta commented Oct 20, 2022

Implements request headers override in middlewares.

New middleware headers

  • x-middleware-override-headers: A comma separated list of all request header names. Headers not listed will be deleted.
  • x-middleware-request-<name>: A new value for the header <name>.

Related Issues

📋 Checklist

Tests

  • The code changed/added as part of this PR has been covered with tests
  • All tests pass locally with yarn test-unit

Code Review

  • This PR has a concise title and thorough description useful to a reviewer
  • Issue from task tracker has a link to this PR

packages/cli/src/util/dev/server.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@Ethan-Arrowood Ethan-Arrowood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - see potential edge case comment. might just need a simple guard.

packages/cli/src/util/dev/headers.ts Outdated Show resolved Hide resolved
@nuta nuta self-assigned this Oct 27, 2022
@nuta nuta added the pr: automerge Automatically merge the PR when checks pass label Oct 27, 2022
@kodiakhq kodiakhq bot merged commit 4eb4d2b into main Oct 27, 2022
@kodiakhq kodiakhq bot deleted the dev-support-middleware-request-headers-overrides branch October 27, 2022 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dev pr: automerge Automatically merge the PR when checks pass semver: minor PR contains new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants