http: respecting configured added content encoding on local replies#20460
http: respecting configured added content encoding on local replies#20460alyssawilk merged 2 commits intoenvoyproxy:mainfrom
Conversation
source/common/http/utility.cc
Outdated
There was a problem hiding this comment.
This part is hard to understand, "modify_headers_" function is used to modify response headers from local_reply_config. If it has "content_type" headers to add, response_headers should have content type, so it should be"
has_custom_content_type = (response_headers->ContentType() != nullptr; )
There was a problem hiding this comment.
oh yeah this was draft because it wasn't ready for review :-) I'd just had 11 unrelated tests failing locally and wanted to make sure it was my machine, not local reply changes :-)
source/common/http/utility.cc
Outdated
There was a problem hiding this comment.
This may not be correct.
How about applying "modify_headers" function after
response_headers->setReferenceContentType
There was a problem hiding this comment.
Which case is not correct?
I'm a bit wary of changing the body and then changing the headers.
There was a problem hiding this comment.
I was worrying response_headers may already has content_type before "modify_headers_" is called. Should we override it?
In reality, it seems we should not have the case. sendLocalReply() usually starts with a empty response_headers. it should not have content_type. Only "modify_headers_" call may add it.
So it is fine then.
There was a problem hiding this comment.
I think it's a valid point - tweaked things to that effect.
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
|
sorted conflicts. @snowp PTAL? |
Risk Level: Low Testing: integration test Docs Changes: n/a Release Notes: inline Runtime guard: yes Fixes envoyproxy#20267 Signed-off-by: Alyssa Wilk <alyssar@chromium.org>
Risk Level: Low
Testing: integration test
Docs Changes: n/a
Release Notes: inline
Runtime guard: yes
Fixes #20267