some http clients say "Content-Encoding: identity" instead of "Content-Encoding: */*". Reference: /n/atom/patch/applied2013/httpdacceptany Date: Wed Jun 19 15:22:32 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/libhttpd/checkcontent.c Wed Jun 19 15:21:23 2013 +++ /sys/src/libhttpd/checkcontent.c Wed Jun 19 15:21:23 2013 @@ -3,6 +3,17 @@ #include #include +static int +acceptany(char *s, char *list) +{ + if(strcmp(s, "*") == 0) + return 1; + if(cistrcmp(list, "Content-Encoding") == 0) + if(cistrcmp(s, "identity") == 0) + return 1; + return 0; +} + int hcheckcontent(HContent *me, HContent *oks, char *list, int size) { @@ -11,7 +22,7 @@ if(oks == nil || me == nil) return 1; for(ok = oks; ok != nil; ok = ok->next){ - if((cistrcmp(ok->generic, me->generic) == 0 || strcmp(ok->generic, "*") == 0) + if((cistrcmp(ok->generic, me->generic) == 0 || acceptany(ok->generic, list)) && (me->specific == nil || cistrcmp(ok->specific, me->specific) == 0 || strcmp(ok->specific, "*") == 0)){ if(ok->mxb > 0 && size > ok->mxb) return 0; @@ -19,7 +30,6 @@ } } - USED(list); if(0){ fprint(2, "list: %s/%s not found\n", me->generic, me->specific); for(; oks != nil; oks = oks->next){