Commit 116ca90d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Spell "content-length" correctly.

Add regresion test for ticket 102



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2749 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent cddb8f49
......@@ -8,7 +8,7 @@ server s1 -listen :9080 {
expect req.proto == HTTP/1.0
expect req.url == "/foo"
txresp -proto HTTP/1.2 -status 201 -msg Foo \
-hdr "Length: 10" \
-hdr "Content-Length: 10" \
-body "987654321\n"
}
......@@ -16,7 +16,7 @@ server s1 -start
client c1 -connect localhost:9080 {
txreq -req PUT -proto HTTP/1.0 -url /foo \
-hdr "Length: 10" \
-hdr "Content-Length: 10" \
-body "123456789\n"
rxresp
expect resp.proto == HTTP/1.2
......
......@@ -5,18 +5,20 @@ test "TCP reuse"
server s1 -listen :9080 {
rxreq
expect req.url == "/1"
txresp -hdr "Length: 10" -body "123456789\n"
txresp -hdr "Content-Length: 10" -body "123456789\n"
rxreq
expect req.url == "/2"
txresp -hdr "Length: 10" -body "987654321\n"
txresp -hdr "Content-Length: 10" -body "987654321\n"
}
server s1 -start
client c1 -connect localhost:9080 {
txreq -url "/1" -req "POST" -hdr "Length: 10" -body "abcdefghi\n"
txreq -url "/1" -req "POST" \
-hdr "Content-Length: 10" -body "abcdefghi\n"
rxresp
txreq -url "/2" -req "POST" -hdr "Length: 10" -body "ihgfedcba\n"
txreq -url "/2" -req "POST" \
-hdr "Content-Length: 10" -body "ihgfedcba\n"
rxresp
}
......
# $Id$
test "Test VCL regsub()"
server s1 {
rxreq
txresp \
-hdr "Connection: close" \
-body "012345\n"
}
varnish v1 -vcl+backend {
sub vcl_recv {
if (req.request == "POST") {
set req.request = "GET";
}
}
} -start
server s1 -start
client c1 {
txreq -req POST -url "/" \
-hdr "Content-Length: 10" \
-body "123456789\n"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
txreq -req POST -url "/" \
-hdr "Content-Length: 10" \
-body "123456789\n"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1002 1001"
}
client c1 -run
......@@ -240,7 +240,7 @@ http_swallow_body(struct http *hp, char **hh)
int l, i;
p = http_find_header(hh, "length");
p = http_find_header(hh, "content-length");
if (p == NULL)
return;
l = strtoul(p, NULL, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment