From c654f31efc548957f10e3f4c1a5060dcea1dcdec Mon Sep 17 00:00:00 2001 From: RaNaN Date: Tue, 10 Jan 2012 00:04:24 +0100 Subject: changed HEAD request --- module/network/HTTPRequest.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'module/network/HTTPRequest.py') diff --git a/module/network/HTTPRequest.py b/module/network/HTTPRequest.py index cd13dd01f..8d65b025f 100644 --- a/module/network/HTTPRequest.py +++ b/module/network/HTTPRequest.py @@ -193,11 +193,19 @@ class HTTPRequest(): if just_header: self.c.setopt(pycurl.FOLLOWLOCATION, 0) self.c.setopt(pycurl.NOBODY, 1) + + # overwrite HEAD request, we want a common request type + if post: + self.c.setopt(pycurl.CUSTOMREQUEST, "POST") + else: + self.c.setopt(pycurl.CUSTOMREQUEST, "GET") + self.c.perform() rep = self.header self.c.setopt(pycurl.FOLLOWLOCATION, 1) self.c.setopt(pycurl.NOBODY, 0) + self.c.setopt(pycurl.CUSTOMREQUEST, 0) else: self.c.perform() -- cgit v1.2.3