trpc-proto-http: fix response header parsing in HttpConsumerInvoker#134
trpc-proto-http: fix response header parsing in HttpConsumerInvoker#134PingruiLi wants to merge 1 commit intotrpc-group:masterfrom
Conversation
The previous implementation iterated over HeaderElement objects and called element.getName() to extract header values. This only returns the token before the first '=' or ';' delimiter, causing truncation of composite header values such as: Content-Type: application/json; charset=utf-8 → "application/json" X-Token: key=abc123 → "key" Set-Cookie: sessionId=abc; Path=/; HttpOnly → "sessionId" Fix this by calling header.getValue() directly to obtain the complete header value, consistent with the approach already used in Http2ConsumerInvoker.
|
I have read the CLA Document and I hereby sign the CLA |
|
I have read the CLA Document and I hereby sign the CLA pingruili seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #134 +/- ##
=====================================================
- Coverage 85.86737% 85.83855% -0.02882%
+ Complexity 4324 4319 -5
=====================================================
Files 436 436
Lines 14371 14370 -1
Branches 1287 1286 -1
=====================================================
- Hits 12340 12335 -5
- Misses 2031 2035 +4
🚀 New features to boost your workflow:
|
| import org.junit.Test; | ||
|
|
||
| /** | ||
| * 测试 HttpConsumerInvoker 中 handleResponse 的响应头解析逻辑 |
|
此修改已在别的pr合并 |
The previous implementation iterated over HeaderElement objects and called element.getName() to extract header values. This only returns the token before the first '=' or ';' delimiter, causing truncation of composite header values such as:
Content-Type: application/json; charset=utf-8 → "application/json"
X-Token: key=abc123 → "key"
Set-Cookie: sessionId=abc; Path=/; HttpOnly → "sessionId"
Fix this by calling header.getValue() directly to obtain the complete header value, consistent with the approach already used in Http2ConsumerInvoker.