NetBSD Problem Report #44880

From www@NetBSD.org  Tue Apr 19 13:26:38 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id B24DD63C2C9
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 19 Apr 2011 13:26:37 +0000 (UTC)
Message-Id: <20110419132636.0D0A063BBDB@www.NetBSD.org>
Date: Tue, 19 Apr 2011 13:26:36 +0000 (UTC)
From: dan@archlinux.org
Reply-To: dan@archlinux.org
To: gnats-bugs@NetBSD.org
Subject: libfetch does not handle "307 Temporary Redirect" correctly
X-Send-Pr-Version: www-1.0

>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
>Last-Modified:  Tue Apr 19 13:40:02 +0000 2011
>Originator:     Dan McGee
>Release:        N/A
>Organization:
Arch Linux
>Environment:
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
>Description:
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.
>How-To-Repeat:
Attempt to fetch from a site returning 307; libfetch will not correctly follow the redirect but will error out.
>Fix:
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.

>Audit-Trail:
From: Dan McGee <dan@archlinux.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: lib/44880: libfetch does not handle "307 Temporary Redirect" correctly
Date: Tue, 19 Apr 2011 08:36:54 -0500

 Downstream bug report:
 https://bugs.archlinux.org/task/23800

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.