7807b5c21514ccf345d2b610e6ba1ed39725d269 galt Mon Sep 23 00:36:32 2019 -0700 Incorporating change to support 307 and 308 redirect codes since the Encode portal seems to use them and customers are starting to ask for them. diff --git src/lib/udc.c src/lib/udc.c index 5b6898f..c74f98d 100644 --- src/lib/udc.c +++ src/lib/udc.c @@ -518,31 +518,31 @@ The signed URL generated for GET cannot be used with HEAD. Instead call GET with byterange=0-0 in netUrlFakeHeadByGet(). This supplies both size via Content-Range response header, as well as Last-Modified header which is important for caching. There are also sites which support byte-ranges but they do not return Content-Length with HEAD. */ if (status == 403 || (status==200 && !sizeString)) { hashFree(&hash); hash = newHash(0); status = netUrlFakeHeadByGet(url, hash); if (status == 206) break; } - if (status != 301 && status != 302) + if (status != 301 && status != 302 && status != 307 && status != 308) return FALSE; ++redirectCount; if (redirectCount > 5) { warn("code %d redirects: exceeded limit of 5 redirects, %s", status, url); return FALSE; } char *newUrl = hashFindValUpperCase(hash, "Location:"); retInfo->ci.redirUrl = cloneString(newUrl); url = transferParamsToRedirectedUrl(url, newUrl); hashFree(&hash); } char *sizeHeader = NULL; if (status == 200)