From 31d919b23d07d9445047e691fcee3e40a41e9872 Mon Sep 17 00:00:00 2001
From: hniksic <devnull@localhost>
Date: Tue, 14 Oct 2003 16:32:15 -0700
Subject: [PATCH] [svn] Accept HTTP status 307 as redirect.

---
 src/ChangeLog | 4 ++++
 src/http.c    | 8 +++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 1c94f771..4fbf39f2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2003-10-15  Hrvoje Niksic  <hniksic@xemacs.org>
+
+	* http.c: Consider status 307 a valid redirect.
+
 2003-10-15  Philip Stadermann  <philip.stadermann@credativ.de>
 
 	* ftp.c (ftp_retrieve_glob): Correctly loop through the list whose
diff --git a/src/http.c b/src/http.c
index 4be6299d..f683b628 100644
--- a/src/http.c
+++ b/src/http.c
@@ -7,7 +7,7 @@ This file is part of GNU Wget.
 GNU Wget is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ (at your option) any later version.
 
 GNU Wget is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -89,8 +89,9 @@ struct cookie_jar *wget_cookie_jar;
 /* Some status code validation macros: */
 #define H_20X(x)        (((x) >= 200) && ((x) < 300))
 #define H_PARTIAL(x)    ((x) == HTTP_STATUS_PARTIAL_CONTENTS)
-#define H_REDIRECTED(x) (((x) == HTTP_STATUS_MOVED_PERMANENTLY)	\
-			 || ((x) == HTTP_STATUS_MOVED_TEMPORARILY))
+#define H_REDIRECTED(x) ((x) == HTTP_STATUS_MOVED_PERMANENTLY	\
+                         || (x) == HTTP_STATUS_MOVED_TEMPORARILY \
+			 || (x) == HTTP_STATUS_TEMPORARY_REDIRECT)
 
 /* HTTP/1.0 status codes from RFC1945, provided for reference.  */
 /* Successful 2xx.  */
@@ -105,6 +106,7 @@ struct cookie_jar *wget_cookie_jar;
 #define HTTP_STATUS_MOVED_PERMANENTLY	301
 #define HTTP_STATUS_MOVED_TEMPORARILY	302
 #define HTTP_STATUS_NOT_MODIFIED	304
+#define HTTP_STATUS_TEMPORARY_REDIRECT  307
 
 /* Client error 4xx.  */
 #define HTTP_STATUS_BAD_REQUEST		400