diff --git a/lib/transfer.c b/lib/transfer.c
index df52014462024b8833fc3e495e27dbce6ae27d58..5823921484d328239a6e9e909d58ab665723f809 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -517,8 +517,14 @@ Transfer(struct connectdata *c_conn)
                 char *start=p;
                 char backup;
 
-                start += 10; /* pass "Location: " */
+                start += 9; /* pass "Location:" */
+
+                /* Skip spaces and tabs. We do this to support multiple
+                   white spaces after the "Location:" keyword. */
+                while(*start && isspace((int)*start ))
+                  start++;
                 ptr = start; /* start scanning here */
+
                 /* scan through the string to find the end */
                 while(*ptr && !isspace((int)*ptr))
                   ptr++;