[FFmpeg-cvslog] http: header field names are case insensitive

Tyler git at videolan.org
Tue Mar 29 03:09:38 CEST 2011


ffmpeg | branch: master | Tyler <tyler at speakertext.com> | Sat Mar 26 17:59:09 2011 -0700| [bc61920d89dde3e35762ace10bb6830a091a15b9] | committer: Luca Barbato

http: header field names are case insensitive

Amazon S3 sends header field names all lowercase.
This is actually acceptable according to the HTTP standard.

http://tools.ietf.org/html/rfc2616#section-4.2

Signed-off-by: Luca Barbato <lu_zero at gentoo.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc61920d89dde3e35762ace10bb6830a091a15b9
---

 libavformat/http.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 2b034a1..9b3d606 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -246,12 +246,12 @@ static int process_line(URLContext *h, char *line, int line_count,
         p++;
         while (isspace(*p))
             p++;
-        if (!strcmp(tag, "Location")) {
+        if (!strcasecmp(tag, "Location")) {
             strcpy(s->location, p);
             *new_location = 1;
-        } else if (!strcmp (tag, "Content-Length") && s->filesize == -1) {
+        } else if (!strcasecmp (tag, "Content-Length") && s->filesize == -1) {
             s->filesize = atoll(p);
-        } else if (!strcmp (tag, "Content-Range")) {
+        } else if (!strcasecmp (tag, "Content-Range")) {
             /* "bytes $from-$to/$document_size" */
             const char *slash;
             if (!strncmp (p, "bytes ", 6)) {
@@ -261,14 +261,14 @@ static int process_line(URLContext *h, char *line, int line_count,
                     s->filesize = atoll(slash+1);
             }
             h->is_streamed = 0; /* we _can_ in fact seek */
-        } else if (!strcmp (tag, "Transfer-Encoding") && !strncasecmp(p, "chunked", 7)) {
+        } else if (!strcasecmp (tag, "Transfer-Encoding") && !strncasecmp(p, "chunked", 7)) {
             s->filesize = -1;
             s->chunksize = 0;
-        } else if (!strcmp (tag, "WWW-Authenticate")) {
+        } else if (!strcasecmp (tag, "WWW-Authenticate")) {
             ff_http_auth_handle_header(&s->auth_state, tag, p);
-        } else if (!strcmp (tag, "Authentication-Info")) {
+        } else if (!strcasecmp (tag, "Authentication-Info")) {
             ff_http_auth_handle_header(&s->auth_state, tag, p);
-        } else if (!strcmp (tag, "Connection")) {
+        } else if (!strcasecmp (tag, "Connection")) {
             if (!strcmp(p, "close"))
                 s->willclose = 1;
         }



More information about the ffmpeg-cvslog mailing list