NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/44880: libfetch does not handle "307 Temporary Redirect" correctly

>Number:         44880
>Category:       lib
>Synopsis:       libfetch does not handle "307 Temporary Redirect" correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 19 13:30:01 +0000 2011
>Originator:     Dan McGee
>Release:        N/A
Arch Linux
Linux galway 2.6.38-ARCH #1 SMP PREEMPT Wed Mar 30 08:47:36 CEST 2011 x86_64 
Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz GenuineIntel GNU/Linux
libfetch is missing a case statement for HTTP_TEMP_REDIRECT in the code.

Note that the fix below is the simplest possible way to get things "working", 
but there are likely still some issues- e.g. HTTP_SEE_OTHER should do the 
redirect but always switch to use the "GET" method, HTTP_MOVED_TEMP follows 
this same behavior in practice on the web. HTTP_TEMP_REDIRECT however should 
reuse the same HTTP verb.
Attempt to fetch from a site returning 307; libfetch will not correctly follow 
the redirect but will error out.
cvs diff: Diffing .
Index: http.c
RCS file: /cvsroot/pkgsrc/net/libfetch/files/http.c,v
retrieving revision 1.29
diff -u -r1.29 http.c
--- http.c      24 Jan 2010 19:10:35 -0000      1.29
+++ http.c      19 Apr 2011 13:25:52 -0000
@@ -974,6 +974,7 @@
                case HTTP_MOVED_PERM:
                case HTTP_MOVED_TEMP:
                case HTTP_SEE_OTHER:
+               case HTTP_TEMP_REDIRECT:
                         * Not so fine, but we still have to read the
                         * headers to get the new location.

Home | Main Index | Thread Index | Old Index