Permalink
Browse files

httpclient: Add HTTP_NOFOLLOW to inhibit the HTTP client from followi…

…ng redirects
  • Loading branch information...
1 parent e1644f8 commit 66ac6e7454a6c7dfb2d2f447b03b366294a42993 @andoma committed Apr 15, 2012
Showing with 4 additions and 0 deletions.
  1. +3 −0 src/fileaccess/fa_http.c
  2. +1 −0 src/fileaccess/fileaccess.h
View
@@ -2698,6 +2698,9 @@ http_request(const char *url, const char **arguments,
// FALLTHRU
case 301:
case 307:
+ if(flags & HTTP_NOFOLLOW)
+ break;
+
if(redirect(hf, &redircount, errbuf, errlen, code, !no_content)) {
http_destroy(hf);
http_headers_free(headers_out);
@@ -184,6 +184,7 @@ struct htsbuf_queue;
#define HTTP_DISABLE_AUTH 0x1
#define HTTP_REQUEST_DEBUG 0x2
#define HTTP_COMPRESSION 0x4
+#define HTTP_NOFOLLOW 0x8
int http_request(const char *url, const char **arguments,
char **result, size_t *result_sizep,

0 comments on commit 66ac6e7

Please sign in to comment.