HTTP binary mode does not percent-encode or decode header values (spec 3.1.3.2)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Start by reading http/basic/src/main/java/io/cloudevents/http/impl/HttpMessageWriter.java and the corresponding HTTP binary-mode reader, then check the linked specification discussion before deciding the applicable behavior. Use the subject and string-extension examples in the issue to define focused interoperability checks; done means both directions handle the specified header values consistently without contradicting the agreed specification.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
The HTTP binary-mode binding does not percent-encode or percent-decode header values, which HTTP Protocol Binding 3.1.3.2 requires. An event sent by a conformant SDK is read back with the escapes intact, and an event sent by this SDK is rejected or mis-decoded by one.
Filed alongside cloudevents/spec#1397, which has the cross-SDK picture, and cloudevents/sdk-go#1331 for the same defect there. If the spec discussion changes the rule, this issue goes away with it, so it may be worth waiting on that before acting.
Spec text
Space (U+0020), Double-quote (U+0022), Percent (U+0025), and any characters outside the printable ASCII range of U+0021-U+007E inclusive [are percent-encoded]
and
When performing percent-decoding (when decoding an HTTP message to a CloudEvent), values that have been unnecessarily percent-encoded MUST be accepted, but encoded byte sequences which are invalid in UTF-8 MUST be rejected.
Where
http/basic/src/main/java/io/cloudevents/http/impl/HttpMessageWriter.java passes the attribute value straight to the header consumer:
putHeader.accept(headerName, value);
and the reader takes it back unchanged. A repository-wide search for URLEncoder or any percent-encoding helper returns nothing, so neither direction is implemented.
I read this from the source rather than running it, unlike the Go case which I executed. Please correct me if a caller-supplied writer is expected to do the encoding.
Expected
For an event with subject of a b and a string extension pct of 100%:
ce-subject: a%20b
ce-pct: 100%25
and on receive, a%20b decodes to a b.
Impact
Only binary mode, and only for values containing space, double quote, percent or non-ASCII, so in practice subject and string extensions. Against sdk-csharp, which does implement the rule:
| direction | value | outcome |
|---|---|---|
| csharp to java | subject = "a b" |
java's application sees a%20b |
| java to csharp | subject = "100%" |
rejected as a malformed escape |
| java to csharp | subject = "100%41" |
decoded to 100A |
Compatibility note
Implementing this is a wire-format change for anyone whose attribute values contain those characters, and a Java sender fixed in isolation would then be misread by an unfixed Java receiver. That is a real migration concern and part of why I filed the spec issue first rather than sending a patch here.
Measured 2026-09-21. I found this checking a C++ SDK for cross-SDK interoperability rather than as a Java SDK user.
- Ngôn ngữ chính
- Java
- Star
- 446
- Fork
- 172
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cloudevents/sdk-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudevents/sdk-java#731 · 1 reaction ·
-
bug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
cloudevents/sdk-java#697 · 3 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
cloudevents/sdk-java#689 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
cloudevents/sdk-java#660 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
cloudevents/sdk-java#711 · 1 bình luận ·
Tất cả issue của cloudevents/sdk-java
Issue tương tự
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Add canonical URLs and a sitemap Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
wso2/dpdp-accelerator#287 ·