Software /
code /
prosody
Comparison
net/http/server.lua @ 5487:03ddf2375d48
net.http.server: The correct Connection header value to look for is Keep-Alive, not keep-alive.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 17 Apr 2013 15:28:20 -0400 |
parent | 5439:bd7b314c2301 |
child | 5503:91052e59375c |
comparison
equal
deleted
inserted
replaced
5486:bcf27dbef6c6 | 5487:03ddf2375d48 |
---|---|
157 | 157 |
158 local date_header = os_date('!%a, %d %b %Y %H:%M:%S GMT'); -- FIXME use | 158 local date_header = os_date('!%a, %d %b %Y %H:%M:%S GMT'); -- FIXME use |
159 local conn_header = request.headers.connection; | 159 local conn_header = request.headers.connection; |
160 conn_header = conn_header and ","..conn_header:gsub("[ \t]", ""):lower().."," or "" | 160 conn_header = conn_header and ","..conn_header:gsub("[ \t]", ""):lower().."," or "" |
161 local httpversion = request.httpversion | 161 local httpversion = request.httpversion |
162 local persistent = conn_header:find(",keep-alive,", 1, true) | 162 local persistent = conn_header:find(",Keep-Alive,", 1, true) |
163 or (httpversion == "1.1" and not conn_header:find(",close,", 1, true)); | 163 or (httpversion == "1.1" and not conn_header:find(",close,", 1, true)); |
164 | 164 |
165 local response_conn_header; | 165 local response_conn_header; |
166 if persistent then | 166 if persistent then |
167 response_conn_header = "Keep-Alive"; | 167 response_conn_header = "Keep-Alive"; |