Overview
| Artifact ID: | 587a9b40eece2baba8ccb8833129bfc170e6e86506c5a0a938f02743408cf9e7 |
|---|---|
| Ticket: | 0063cbcada41024be2d778dc719a64fe2144e0aa
http: wrong parameter "-headers A" not detected and sent anyway |
| User & Date: | oehhar on 2020-09-27 17:39:19 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
This is just a proposal to enhance the http package, not important. If the -headers argument is not a dict, communication happens with stange data. There is no error shown. My example: <verbatim> set hHTTP [http::geturl http://localhost:30030/postfile/test.csv\ -headers {{Authorization "Basic [binary encode base64 user:pw]"}}\ -querychannel $hFile\ -command [namespace code TransmitEnd]\ -type "text/csv;charset=utf-8"\ -timeout [expr 180000] </verbatim> The issue are the double "{{" in the -headers argument. That looks and is stupid. But it happend to me in deep code nesting so not so obvious... The sent headers are: <verbatim> host -> 'localhost:30030' user-agent -> 'Mozilla/5.0 (Windows; U; Windows NT 10.0) http/2.10.0 Tcl/8.6.10' connection -> 'close' </verbatim> My test server errors out due to missing content-length. This issue is, that the line 1415: <verbatim> dict for {key value} $state(-headers) { </verbatim> fails and is catched by a large general catch. The http log is: <verbatim> ^A1 URL http://localhost:30030/postfile/el1068.csv - token ::http::1 {Using sock0652E0D0 for localhost:30030 - token ::http::1} {} L():2020-09-27 19:34:32 5 > (::uitk::uitkStateSet State Transmit) ^B1 begin sending request - token ::http::1 {WARNING - if testing, pay special attention to this case (GI) which is seldom executed - token ::http::1} {Closing socket sock0652E0D0 (no connection info)} </verbatim> Thank you, Harald - foundin changed to: "2.10.0a1"
- is_private changed to: "0"
- login: "oehhar"
- priority changed to: "5 Medium"
- private_contact changed to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "oehhar"
- subsystem changed to: "29. http Package"
- title changed to:
http: wrong parameter "-headers A" not detected and sent anyway
- type changed to: "RFE"