diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-09-06 14:29:48 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-09-06 14:31:25 -0700 |
commit | 78c7455fc3c7e0e464134d5d294e6185a0114e56 (patch) | |
tree | 9f56986b5ffebfb8f8fa92d6cecd6f67557f0556 | |
parent | bace4364e8a7d0ac261e407732b9354d2f017045 (diff) | |
download | unicorn-78c7455fc3c7e0e464134d5d294e6185a0114e56.tar.gz |
Avoid a negative conditional in the process and having an explicit else in there makes this piece easier to track. Also explain /why/ the Host: header can get ignored.
-rw-r--r-- | ext/unicorn_http/unicorn_http.rl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl index 063b326..9aa0037 100644 --- a/ext/unicorn_http/unicorn_http.rl +++ b/ext/unicorn_http/unicorn_http.rl @@ -156,8 +156,12 @@ static void write_value(VALUE req, struct http_parser *hp, e = rb_hash_aref(req, f); if (e == Qnil) { hp->cont = rb_hash_aset(req, f, v); - } else if (f != g_http_host) { - /* full URLs in REQUEST_URI take precedence for the Host: header */ + } else if (f == g_http_host) { + /* + * ignored, absolute URLs in REQUEST_URI take precedence over + * the Host: header (ref: rfc 2616, section 5.2.1) + */ + } else { rb_str_buf_cat(e, ",", 1); hp->cont = rb_str_buf_append(e, v); } |