PUT requests with Varnish and Chrome
Kevin Pettijohn
kpettijohn at tarot.com
Thu Nov 10 18:16:17 CET 2011
Hello all,
I have been trying to wrap my head around a Varnish/Chrome issue regarding
http PUT requests and would appreciate any ideas/insight. The problem is
when we use a PUT request through Chrome (15.0.874.106) the request
reaches Varnish (2.1.5) from the client as a PUT but when varnish sends
the request to the backend it has turned into a GET request. We have only
been able to recreate this issue in Chrome. In order to get around this
issue for Chrome we are using Œpipe¹ which as expected uses PUT between
both the client and the server.
Varnishlog:
16 SessionOpen c 10.3.10.124 60714 :80
16 ReqStart c 10.3.10.124 60714 1424074046
16 RxRequest c PUT
16 RxURL c /fun-and-games/cosmic-profile/get_cosmic_profile
16 RxProtocol c HTTP/1.1
16 RxHeader c Host: stage.blah.com
16 RxHeader c Connection: keep-alive
16 RxHeader c Content-Length: 257
16 RxHeader c Origin: http://stage.blah.com
16 RxHeader c X-Requested-With: XMLHttpRequest
16 RxHeader c User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X
10_6_8) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106
Safari/535.2
16 RxHeader c Content-Type: application/x-www-form-urlencoded
16 RxHeader c Accept: */*
16 RxHeader c Referer:
http://stage.blah.com/free-online-games/cosmic-profile/
16 RxHeader c Accept-Encoding: gzip,deflate,sdch
16 RxHeader c Accept-Language: en-US,en;q=0.8
16 RxHeader c Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
16 RxHeader c Cookie: csession=fbph0fapbes3rin0kh7iphhj76;
__utma=70084306.1318547882.1320866763.1320878236.1320885100.4;
__utmc=70084306;
__utmz=70084306.1320866763.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none
)
16 VCL_call c recv
16 VCL_return c lookup
16 VCL_call c hash
16 VCL_return c hash
16 VCL_call c miss
16 VCL_return c fetch
16 Backend c 17 t4dev t4dev
17 TxRequest - GET
17 TxURL - /fun-and-games/cosmic-profile/get_cosmic_profile
17 TxProtocol - HTTP/1.1
17 TxHeader - Host: stage.blah.com
17 TxHeader - Origin: http://stage.blah.com
17 TxHeader - X-Requested-With: XMLHttpRequest
17 TxHeader - User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X
10_6_8) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106
Safari/535.2
17 TxHeader - Content-Type: application/x-www-form-urlencoded
17 TxHeader - Accept: */*
17 TxHeader - Referer:
http://stage.blah.com/free-online-games/cosmic-profile/
17 TxHeader - Accept-Encoding: gzip,deflate,sdch
17 TxHeader - Accept-Language: en-US,en;q=0.8
17 TxHeader - Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
17 TxHeader - Cookie: csession=fbph0fapbes3rin0kh7iphhj76;
__utma=70084306.1318547882.1320866763.1320878236.1320885100.4;
__utmc=70084306;
__utmz=70084306.1320866763.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none
)
17 TxHeader - X-Varnish: 1424074046
17 RxProtocol - HTTP/1.1
17 RxStatus - 200
17 RxResponse - OK
17 RxHeader - Content-Type: application/json
17 RxHeader - Connection: keep-alive
17 RxHeader - Transfer-Encoding: chunked
16 TTL c 1424074046 RFC 120 1320888101 0 0 0 0
16 VCL_call c fetch
16 VCL_return c deliver
16 ObjProtocol c HTTP/1.1
16 ObjStatus c 200
16 ObjResponse c OK
16 ObjHeader c Content-Type: application/json
17 Fetch_Body - 3 0 1
17 Length - 2
17 BackendReuse - t4dev
16 VCL_call c deliver
The PUT request:
$.ajax('/fun-and-games/cosmic-profile/get_cosmic_profile', {
data: {
name: 'Kevin',
birth_month: 'October',
birth_day: '05',
birth_year: '1970',
birth_hour: '07',
birth_minute: '12',
birth_ampm: 'PM',
gender: 'male',
birth_cityID: '1391126',
picture_url:
'http://avatars.blah.com/profile_d4cca4e1-91d9-4f5e-9699-3519cb15ce3f.jpg',
dontknow: false,
persist: true
}, type: "PUT",
success: function(data) {
console.log('SUCCESS', data);
},
error: function(data) {
console.log('ERROR', data);
}
});
Any ideas would be much appreciated!
Thanks,
Kevin
More information about the varnish-misc
mailing list