microsoftarchive / http2-katana

HTTP 2.0 with Katana
134 stars 34 forks source link

Strange header set emission in PUSH_PROMISE #66

Closed shigeki closed 10 years ago

shigeki commented 10 years ago

When I accessed to https://http2katanatest.cloudapp.net:8433/root/index.html with my HTTP2 client. I found PUSH_PROMISE was sent from the server and strange header sets were emitted such that duplicated :method are POST/GET and :scheme is http.

My debug log is as below. There might have some inconsistent issues of HPACK header tables between the server and my client.

LOG: 168.63.18.174 Wed Jan 22 2014 23:04:46 GMT+0900 (JST) OnFrameHeader {"length":64,"type":5,"flags":4,"stream_id":1} http_client
LOG: 168.63.18.174 Wed Jan 22 2014 23:04:46 GMT+0900 (JST) OnPUSH_PROMISE {"length":64,"type":5,"flags":4,"stream_id":1,"promised_stre
am_id":2} http_client
HPACK 11937: Decoder.parse, IndexedHeader index: 2
HPACK 11937: Decoder.parse, LiteralHeaderWithIncrementalIndexing(New Name) name: odrhj , value: ujbbhuk9=dkspsgh%h,4
HPACK 11937: Header Set Emission: {"name":"odrhj","value":"ujbbhuk9=dkspsgh%h,4"}
HPACK 11937: Evicted: evicted_common_flag_index_list= []
HPACK 11937: Decoder.parse, LiteralHeaderWithIncrementalIndexing(New Name) name: ormhjbf9hz , value: jhhd2LVb_rhsgh%7kbm8rdd%_sholcca
HPACK 11937: Header Set Emission: {"name":"ormhjbf9hz","value":"jhhd2LVb_rhsgh%7kbm8rdd%_sholcca"}
HPACK 11937: Evicted: evicted_common_flag_index_list= []
HPACK 11937: Decoder.parse, IndexedHeader index: 9
HPACK 11937: Header Set Emission: {"name":":method","value":"POST","type":"static_table"}
HPACK 11937: Evicted: evicted_common_flag_index_list= []
HPACK 11937: Header Set Emission: {"name":":scheme","value":"http","index":4}
HPACK 11937: Header Set Emission: {"name":":path","value":"/root/index.html","index":6}
HPACK 11937: Header Set Emission: {"name":":method","value":"GET","index":7}
shigeki commented 10 years ago

Sorry, let me check again

shigeki commented 10 years ago

The above was my bug for my context. After my bug was fixed, most of headers are fine except :scheme

Here is also the debug message as :scheme is http even I access via https

LOG: 168.63.18.174 Wed Jan 22 2014 23:28:08 GMT+0900 (JST) OnFrameHeader {"length":64,"type":5,"flags":4,"stream_id":1} http_client
LOG: 168.63.18.174 Wed Jan 22 2014 23:28:08 GMT+0900 (JST) OnPUSH_PROMISE {"length":64,"type":5,"flags":4,"stream_id":1,"promised_stre
am_id":2} http_client
HPACK 11994: Decoder.parse, IndexedHeader index: 2
HPACK 11994: Header Set Emission: {"name":":method","value":"GET","type":"static_table"}
HPACK 11994: Evicted: evicted_common_flag_index_list= []
HPACK 11994: Decoder.parse, LiteralHeaderWithIncrementalIndexing(New Name) name: :path , value: /root/simpleTest.txt
HPACK 11994: Header Set Emission: {"name":":path","value":"/root/simpleTest.txt"}
HPACK 11994: Evicted: evicted_common_flag_index_list= []
HPACK 11994: Decoder.parse, LiteralHeaderWithIncrementalIndexing(New Name) name: :authority , value: http2katanatest.cloudapp.net:8443
HPACK 11994: Header Set Emission: {"name":":authority","value":"http2katanatest.cloudapp.net:8443"}
HPACK 11994: Evicted: evicted_common_flag_index_list= []
HPACK 11994: Decoder.parse, IndexedHeader index: 9
HPACK 11994: Header Set Emission: {"name":":scheme","value":"http","type":"static_table"}
HPACK 11994: Evicted: evicted_common_flag_index_list= []
jeffmendoza commented 10 years ago

Are you sending the request as plain http, and using upgrade?

shigeki commented 10 years ago

I'm sending https with ALPN to port 443.

jeffmendoza commented 10 years ago

our code is showing that we should be reusing whatever scheme header is sent with the original request, in this case for /root/index.html

shigeki commented 10 years ago

Do you mean you push http request during https session?

jeffmendoza commented 10 years ago

no, are you sure your :scheme in your request is https and not http?

shigeki commented 10 years ago

OK, I will check my code.

shigeki commented 10 years ago

Sorry, I found my bug checking scheme on my client request. Working fine. Close this. Thanks