Repository navigation
Conversation
Encode the values of ce- headers on write and decode them on read as described in section 3.1.3.2 of the HTTP protocol binding. Signed-off-by: emir <52245396+EmiRZx@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #748
binary mode wrote attribute values to
ce-headers as they were and read them back unchanged. this implements section 3.1.3.2 of the HTTP binding as clarified in cloudevents/spec#1402. it follows cloudevents/sdk-go#1356.on write the UTF-8 bytes outside U+0021-U+007E are percent-encoded along with
%and". a space is only encoded when it's leading or trailing. on read the value is trimmed. quotes are removed after their backslash escapes are resolved and then%XXis decoded. a%without two hex digits after it is kept. bytes that aren't valid UTF-8 are rejected withINVALID_ATTRIBUTE_VALUE. Content-Type isn't touched in either direction.the helper is
HttpHeaderValuesin core since vertx and restful-ws don't depend on http-basic. it's used by the http-basic, vertx and restful-ws readers and writers and by the spring webflux writer. spring's other paths go through http-basic.this changes the wire format for values with those characters. an unfixed receiver sees
100%25instead of100%. a%XXfrom an unfixed sender is now decoded. soce-source: https://x/a%20bbecomeshttps://x/a band is rejected as a URI. sdk-go made the change without a switch so I didn't add one. duglin suggested a flag for a transition period in cloudevents/spec#1397. I can add one if you'd like.encode and decode give the same results as sdk-go's on 40 inputs. the new binding tests use a subject of
100% "sure" €and fail without the change.