diff --git a/http-tools.red b/http-tools.red index c7f4c82..4202fda 100644 --- a/http-tools.red +++ b/http-tools.red @@ -98,7 +98,7 @@ headers!: context [ other-headers: none ] -parse-headers: func [query] [ +parse-headers: func [query /local headers raw key value keys] [ headers: make headers! [] raw: make map! 50 key: value: none @@ -122,12 +122,23 @@ parse-headers: func [query] [ "GATEWAY_INTERFACE" gateway-interface "SERVER_PROTOCOL" server-protocol "REQUEST_METHOD" request-method + "PATH_INFO" path-info + "PATH_TRANSLATED" path-translated "QUERY_STRING" query-string "CONTENT_TYPE" Content-Type + "CONTENT_LENGTH" content-length + "AUTH_TYPE" auth-type ] [ headers/:red-key: raw/:cgi-key raw/:cgi-key: none ] + keys: keys-of raw + while [not tail? keys] [ + if not parse key: first keys [["HTTP_" | "HTTPS_" | "AUTH_" | "CERT_"] thru end] [ + raw/:key: none + ] + keys: next keys + ] headers/other-headers: raw headers ] @@ -357,4 +368,4 @@ load-non-utf: func [ data [binary!] ] [ copy collect/into [forall data [keep to char! data/1]] {} -] \ No newline at end of file +]