Lines 254-259
Link Here
|
254 |
comp.hostname = apr_pstrcat(r->pool, comp.hostname, domain, NULL); |
254 |
comp.hostname = apr_pstrcat(r->pool, comp.hostname, domain, NULL); |
255 |
} |
255 |
} |
256 |
|
256 |
|
|
|
257 |
const char *host = apr_table_get(r->headers_in, "Host"); |
258 |
if (NULL != host) { |
259 |
char *port_str = strstr(host, ":"); |
260 |
int port; |
261 |
|
262 |
if (port_str) { |
263 |
*port_str = 0; |
264 |
port_str++; |
265 |
port = atoi(port_str); |
266 |
} else { |
267 |
port = ap_default_port(r); |
268 |
} |
269 |
|
270 |
if (port != comp.port || strcmp(host, comp.hostname) != 0) { |
271 |
result.err.status = HTTP_BAD_GATEWAY; |
272 |
return result; |
273 |
} |
274 |
} |
275 |
|
257 |
/* now, if a hostname was provided, then verify that it represents the |
276 |
/* now, if a hostname was provided, then verify that it represents the |
258 |
same server as the current connection. note that we just use our |
277 |
same server as the current connection. note that we just use our |
259 |
port, since we've verified the URI matches ours */ |
278 |
port, since we've verified the URI matches ours */ |
Lines 1419-1429
Link Here
|
1419 |
|
1438 |
|
1420 |
retVal = ap_meets_conditions(r); |
1439 |
retVal = ap_meets_conditions(r); |
1421 |
|
1440 |
|
1422 |
/* If-None-Match '*' fix. If-None-Match '*' request should succeed |
1441 |
/* If-None-Match '*' fix. If-None-Match '*' request should succeed |
1423 |
* if the resource does not exist. */ |
1442 |
* if the resource does not exist. */ |
1424 |
if (retVal == HTTP_PRECONDITION_FAILED) { |
1443 |
if (retVal == HTTP_PRECONDITION_FAILED) { |
1425 |
/* Note. If if_none_match != NULL, if_none_match is the culprit. |
1444 |
/* Note. If if_none_match != NULL, if_none_match is the culprit. |
1426 |
* Since, in presence of If-None-Match, |
1445 |
* Since, in presence of If-None-Match, |
1427 |
* other If-* headers are undefined. */ |
1446 |
* other If-* headers are undefined. */ |
1428 |
if ((if_none_match = |
1447 |
if ((if_none_match = |
1429 |
apr_table_get(r->headers_in, "If-None-Match")) != NULL) { |
1448 |
apr_table_get(r->headers_in, "If-None-Match")) != NULL) { |