Project

General

Profile

lighttpd.mod_proxy.caseless-compare.patch

[PATCH] Remove forwarding "Connection", "Host" and "Keep-Alive" -- conny - Anonymous, 2005-12-21 15:07

View differences:

lighttpd-1.4.8/src/mod_proxy.c
423 423

  
424 424
static int proxy_create_env(server *srv, handler_ctx *hctx) {
425 425
	size_t i;
426
	int cmp;
426 427
	
427 428
	connection *con   = hctx->remote_conn;
428 429
	buffer *b;
......
449 450
		ds = (data_string *)con->request.headers->data[i];
450 451
		
451 452
		if (ds->value->used && ds->key->used) {
452
			if (buffer_is_equal_string(ds->key, CONST_STR_LEN("Connection"))) continue;
453
			if (              (0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Connection"))))
454
               	|| (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Host"))))
455
                || (cmp > 0 && 0 == (cmp = buffer_caseless_compare(CONST_BUF_LEN(ds->key), CONST_STR_LEN("Keep-Alive"))))
456
			   ) 
457
				continue;
453 458
			
454 459
			buffer_append_string_buffer(b, ds->key);
455 460
			BUFFER_APPEND_STRING_CONST(b, ": ");