[3/3] http: Don't add a Range: bytes=0- header for POST

Message ID 1320916777-57324-3-git-send-email-martin@martin.st
State Committed
Commit f2d0015531a05587de87575ff73c95b1f95b6df7
Headers show

Commit Message

Martin Storsjö Nov. 10, 2011, 9:19 a.m.
That header simply doesn't make sense in that context.
---
 libavformat/http.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Anton Khirnov Nov. 10, 2011, 10:54 a.m. | #1
On Thu, 10 Nov 2011 11:19:37 +0200, Martin Storsjö <martin@martin.st> wrote:
> That header simply doesn't make sense in that context.
> ---

Ok I think.

Patch

diff --git a/libavformat/http.c b/libavformat/http.c
index 55407b1..7cbd51a 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -313,7 +313,7 @@  static int http_connect(URLContext *h, const char *path, const char *hoststr,
     if (!has_header(s->headers, "\r\nAccept: "))
         len += av_strlcpy(headers + len, "Accept: */*\r\n",
                           sizeof(headers) - len);
-    if (!has_header(s->headers, "\r\nRange: "))
+    if (!has_header(s->headers, "\r\nRange: ") && !post)
         len += av_strlcatf(headers + len, sizeof(headers) - len,
                            "Range: bytes=%"PRId64"-\r\n", s->off);
     if (!has_header(s->headers, "\r\nConnection: "))