diff --git a/basis/http/http-tests.factor b/basis/http/http-tests.factor index 2b9cd100f7..0d4282b1d7 100644 --- a/basis/http/http-tests.factor +++ b/basis/http/http-tests.factor @@ -9,6 +9,8 @@ IN: http.tests [ "text/html" utf8 ] [ "text/html; charset=UTF-8" parse-content-type ] unit-test +[ "text/html" utf8 ] [ "text/html; charset=\"utf-8\"" parse-content-type ] unit-test + [ "application/octet-stream" binary ] [ "application/octet-stream" parse-content-type ] unit-test : lf>crlf "\n" split "\r\n" join ; diff --git a/basis/http/http.factor b/basis/http/http.factor index c7f10a789d..bf58f5c238 100755 --- a/basis/http/http.factor +++ b/basis/http/http.factor @@ -213,7 +213,10 @@ TUPLE: post-data data params content-type content-encoding ; swap >>content-type ; : parse-content-type-attributes ( string -- attributes ) - " " split harvest [ "=" split1 [ >lower ] dip ] { } map>assoc ; + " " split harvest [ + "=" split1 + [ >lower ] [ "\"" ?head drop "\"" ?tail drop ] bi* + ] { } map>assoc ; : parse-content-type ( content-type -- type encoding ) ";" split1