diff options
Diffstat (limited to 'ext/kcar/kcar.rl')
-rw-r--r-- | ext/kcar/kcar.rl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/kcar/kcar.rl b/ext/kcar/kcar.rl index 336af55..9d04dd8 100644 --- a/ext/kcar/kcar.rl +++ b/ext/kcar/kcar.rl @@ -489,7 +489,6 @@ static void write_response_value(struct http_parser *hp, VALUE hdr, } } -/* TODO cache */ static VALUE req_field(const char *ptr, size_t len) { size_t pfxlen = sizeof("HTTP_") - 1; @@ -501,7 +500,7 @@ static VALUE req_field(const char *ptr, size_t len) assert(*(dst + RSTRING_LEN(str)) == '\0' && "string didn't end with \\0"); /* paranoia */ - return str_dd_freeze(str); + return str; } static void snake_upcase(char *ptr, size_t len) @@ -570,6 +569,8 @@ static void write_request_value(struct http_parser *hp, VALUE env, hp->v.host = val; } else { key = req_field(fptr, flen); + if (!HASH_ASET_DEDUPE) + key = str_dd_freeze(key); } existing = rb_hash_aref(env, key); if (NIL_P(existing)) { |