View | Details | Raw Unified | Return to bug 38182
Collapse All | Expand All

(-)httpd-2.2.9-orig/modules/dav/main/mod_dav.c (-1 / +1 lines)
Lines 2609-2615 Link Here
2609
        return HTTP_BAD_REQUEST;
2609
        return HTTP_BAD_REQUEST;
2610
    }
2610
    }
2611
2611
2612
    lookup = dav_lookup_uri(dest, r, 1 /* must_be_absolute */);
2612
    lookup = dav_lookup_uri(dest, r, 0 /* must_be_absolute - see RFC 4918 */);
2613
    if (lookup.rnew == NULL) {
2613
    if (lookup.rnew == NULL) {
2614
        if (lookup.err.status == HTTP_BAD_REQUEST) {
2614
        if (lookup.err.status == HTTP_BAD_REQUEST) {
2615
            /* This supplies additional information for the default message. */
2615
            /* This supplies additional information for the default message. */
(-)httpd-2.2.9-orig/modules/dav/main/util.c (-2 / +26 lines)
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
    if (comp.hostname != NULL) {
258
    	const char *host = apr_table_get(r->headers_in, "Host");
259
    	if (NULL != host) {
260
    		char *port_str = strstr(host, ":");
261
    		int port;
262
263
    		if (port_str) {
264
    			*port_str = 0;
265
    			port_str++;
266
    			port = atoi(port_str);
267
    		} else {
268
    			port = ap_default_port(r);
269
    		}
270
271
            if (comp.port == 0)
272
                comp.port = apr_uri_port_of_scheme(comp.scheme);
273
274
    		if (port != comp.port || strcmp(host, comp.hostname) != 0) {
275
    			result.err.status = HTTP_BAD_GATEWAY;
276
    			return result;
277
    		}
278
    	}
279
    }
280
257
    /* now, if a hostname was provided, then verify that it represents the
281
    /* 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
282
       same server as the current connection. note that we just use our
259
       port, since we've verified the URI matches ours */
283
       port, since we've verified the URI matches ours */
Lines 1419-1429 Link Here
1419
1443
1420
    retVal = ap_meets_conditions(r);
1444
    retVal = ap_meets_conditions(r);
1421
1445
1422
    /* If-None-Match '*' fix. If-None-Match '*' request should succeed 
1446
    /* If-None-Match '*' fix. If-None-Match '*' request should succeed
1423
     * if the resource does not exist. */
1447
     * if the resource does not exist. */
1424
    if (retVal == HTTP_PRECONDITION_FAILED) {
1448
    if (retVal == HTTP_PRECONDITION_FAILED) {
1425
        /* Note. If if_none_match != NULL, if_none_match is the culprit.
1449
        /* Note. If if_none_match != NULL, if_none_match is the culprit.
1426
         * Since, in presence of If-None-Match, 
1450
         * Since, in presence of If-None-Match,
1427
         * other If-* headers are undefined. */
1451
         * other If-* headers are undefined. */
1428
        if ((if_none_match =
1452
        if ((if_none_match =
1429
            apr_table_get(r->headers_in, "If-None-Match")) != NULL) {
1453
            apr_table_get(r->headers_in, "If-None-Match")) != NULL) {
(-)httpd-2.2.9-orig/modules/proxy/mod_proxy.c (+51 lines)
Lines 494-499 Link Here
494
    }
494
    }
495
    return ret;
495
    return ret;
496
}
496
}
497
498
static void proxy_trans_destination(request_rec *r)
499
{
500
	char *dest = apr_table_get(r->headers_in, "Destination");
501
	if (!dest)
502
		return;
503
504
505
    apr_uri_t dest_uri;
506
507
    if (apr_uri_parse(r->pool, dest, &dest_uri) != APR_SUCCESS) {
508
        return;
509
    }
510
511
    void *sconf = r->server->module_config;
512
    proxy_server_conf *conf =
513
    (proxy_server_conf *) ap_get_module_config(sconf, &proxy_module);
514
    int i, len;
515
    proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config,
516
                                                 &proxy_module);
517
518
    const char *fake;
519
    const char *real;
520
    struct proxy_alias *ent = (struct proxy_alias *) conf->aliases->elts;
521
522
    for (i = 0; i < conf->aliases->nelts; i++) {
523
        const char *use_uri = dest_uri.path;
524
        if ((dconf->interpolate_env == 1)
525
            && (ent[i].flags & PROXYPASS_INTERPOLATE)) {
526
            fake = proxy_interpolate(r, ent[i].fake);
527
            real = proxy_interpolate(r, ent[i].real);
528
        }
529
        else {
530
            fake = ent[i].fake;
531
            real = ent[i].real;
532
        }
533
534
        if (!ent[i].regex) {
535
        	len = alias_match(use_uri, fake);
536
			if (0 == len)
537
				continue;
538
539
        	use_uri = apr_pstrcat(r->pool, real, use_uri + len, NULL);
540
        	apr_table_set(r->headers_in, "Destination", use_uri);
541
        	return;
542
        }
543
    }
544
}
545
497
static int proxy_trans(request_rec *r)
546
static int proxy_trans(request_rec *r)
498
{
547
{
499
    void *sconf = r->server->module_config;
548
    void *sconf = r->server->module_config;
Lines 510-515 Link Here
510
    char *found = NULL;
559
    char *found = NULL;
511
    int mismatch = 0;
560
    int mismatch = 0;
512
561
562
    proxy_trans_destination(r);
563
513
    if (r->proxyreq) {
564
    if (r->proxyreq) {
514
        /* someone has already set up the proxy, it was possibly ourselves
565
        /* someone has already set up the proxy, it was possibly ourselves
515
         * in proxy_detect
566
         * in proxy_detect

Return to bug 38182