Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http header name casing error #2734

Open
sourHobbes opened this issue Oct 20, 2023 · 0 comments
Open

Http header name casing error #2734

sourHobbes opened this issue Oct 20, 2023 · 0 comments

Comments

@sourHobbes
Copy link

sourHobbes commented Oct 20, 2023

Sevicetalk > 0.42.21 Java 17 macOS m2 Sonoma

If header name validation is turned off, and we add a capital cased header name to http client we get a very cryptic error in the framework. We seem to be getting a 415 response code, when in fact looking at h2 frame logging the stream was reset after sending headers, rightly due to the invalid capital case in header name.


these are the logs when we have error
traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] OUTBOUND SETTINGS: ack=false settings={ENABLE_PUSH=0, MAX_CONCURRENT_STREAMS=0, INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] OUTBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=1966082
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] INBOUND SETTINGS: ack=false settings={INITIAL_WINDOW_SIZE=1048576, MAX_HEADER_LIST_SIZE=8192}
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] OUTBOUND SETTINGS: ack=true
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] INBOUND WINDOW_UPDATE: streamId=0 windowSizeIncrement=1966082
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] INBOUND SETTINGS: ack=true
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] OUTBOUND HEADERS: streamId=3 headers=DefaultHttp2Headers[:authority: localhost:8448, :method: POST, :scheme: https, :path: /broker/1/1/getAsset, content-type: application/json, conversationId: 30ec8739-97b1-431e-993e-dfd8779082c6, x-conversation-id: 30ec8739-97b1-431e-993e-dfd8779082c6, content-type: application/json] padding=0 endStream=false
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] OUTBOUND DATA: streamId=3 padding=0 endStream=false length=51 bytes=7b2261737365744964223a22746573745465726d734964222c2264734964223a2235222c2274797065223a227465726d73227d
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] OUTBOUND DATA: streamId=3 padding=0 endStream=true length=0 bytes=
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] INBOUND RST_STREAM: streamId=3 errorCode=1
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] OUTBOUND RST_STREAM: streamId=3 errorCode=8
[servicetalk-global-io-executor-1-4] INFO traffic-log - [id: 0x853721c2, L:/[0:0:0:0:0:0:0:1%0]:52340 - R:localhost/[0:0:0:0:0:0:0:1]:8448] INBOUND GO_AWAY: lastStreamId=2147483647 errorCode=1 length=23 bytes=53747265616d203320646f6573206e6f74206578697374

I am wondering if instead of showing 415 there was a way in the framework to create an exception with the error code in http2 rst_stream.

The framework does seem to take care of stuff when we create a new request using a http1.1 client and then pass it to a http2.0 client. However when we directly create a http2.o request with wrong header case the framework doesn’t help.

Is there some setting that can be turned so header names are auto fixed? Especially in environments where we proxy requests between http1.1 and http2.0 clients?

this flow was working fine prior to .42.20

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

No branches or pull requests

1 participant