Skip to content

swift: throw when setting restricted headers#275

Closed
rebello95 wants to merge 1 commit intomasterfrom
swift-throw-when-setting-restricted-headers
Closed

swift: throw when setting restricted headers#275
rebello95 wants to merge 1 commit intomasterfrom
swift-throw-when-setting-restricted-headers

Conversation

@rebello95
Copy link
Copy Markdown
Contributor

@rebello95 rebello95 commented Jul 22, 2019

Since we expose headers in the Request type, it's technically possible for consumers to set restricted headers that we will be setting internally within the library (any header starting with : in this case - :method for example).

To prevent this, we will throw an error when any of these headers/trailers is set manually.

Context: https://envoyproxy.slack.com/archives/CKQ2LK23G/p1563826656004700

Signed-off-by: Michael Rebello mrebello@lyft.com

Since we expose headers in the `Request` type, it's technically possible for consumers to set restricted headers that we will be setting internally within the library (any header starting with `:` in this case - `:method` for example).

To prevent this, we will throw an error when any of these headers/trailers is set manually.

Context: https://envoyproxy.slack.com/archives/CKQ2LK23G/p1563826656004700

Signed-off-by: Michael Rebello <mrebello@lyft.com>
@rebello95
Copy link
Copy Markdown
Contributor Author

Will likely close this PR instead of merging in order to prevent the poor ergonomics of having to try when using the builders. Instead, we can strip any headers that start with : before executing request(s). Discussing in the thread

@rebello95
Copy link
Copy Markdown
Contributor Author

Superseded by #288

@rebello95 rebello95 closed this Jul 23, 2019
@rebello95 rebello95 deleted the swift-throw-when-setting-restricted-headers branch July 23, 2019 19:46
rebello95 added a commit that referenced this pull request Jul 23, 2019
Adds converters to go from `Request` to a set of headers that upstream Envoy understands.

This will be utilized by the request logic in the `Envoy` class.

Previous consideration: #275

Signed-off-by: Michael Rebello <me@michaelrebello.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 28, 2022
Adds converters to go from `Request` to a set of headers that upstream Envoy understands.

This will be utilized by the request logic in the `Envoy` class.

Previous consideration: envoyproxy/envoy-mobile#275

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit to envoyproxy/envoy that referenced this pull request Nov 29, 2022
Adds converters to go from `Request` to a set of headers that upstream Envoy understands.

This will be utilized by the request logic in the `Envoy` class.

Previous consideration: envoyproxy/envoy-mobile#275

Signed-off-by: Michael Rebello <me@michaelrebello.com>
Signed-off-by: JP Simard <jp@jpsim.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant