#101 CheckSourceUrl uses HEAD HTTP method instead of GET
Closed: Invalid None Opened 11 years ago by mizdebsk.

CheckSourceUrl seems to be using HTTP HEAD method to access external URLs. Some servers don't support or allow HEAD requests, making F-R report false positives (invalid URLS, while they are valid).

Head request fails:
{{{
$ echo "GET / HTTP/1.1
Host: www.jboss.org

" | nc www.jboss.org 80 | head -1
HTTP/1.1 200 OK
}}}

But GET works:
{{{
$ echo "HEAD / HTTP/1.1
Host: www.jboss.org

" | nc www.jboss.org 80 | head -1
HTTP/1.1 403 Forbidden
}}}

F-R should use GET instead of HEAD for HTTP URLs.


Hm... seems that your code snippets are mixed up(?)

I'm no python wizard, bit it seems that in order to specify method you need to use urllib2 instead of urllib. Certainly doable.

Is there any caveats using GET instead of HEAD? Since current code seems to work "mostly", would it be better to try with HEAD using GET as fallback?

Replying to [comment:1 leamas]:

Hm... seems that your code snippets are mixed up(?)

Oh yes, they are indeed.

Is there any caveats using GET instead of HEAD? Since current code seems to work "mostly", would it be better to try with HEAD using GET as fallback?

This is a bug in rpmlint not Fedora-Review. Feel free to close it, sorry for confusion.

I'm closing it. If such a situation would happen again, feel free to close it yourself - noone is in better position to close a bug than the submitter :)

Login to comment on this ticket.

Metadata