aboutsummaryrefslogtreecommitdiffstats
path: root/src/cow_http_hd.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-01-02 15:39:47 +0100
committerLoïc Hoguin <[email protected]>2015-01-02 15:39:47 +0100
commitbdad83a2abc9da946ad95ef1c3c030a3b2b706ea (patch)
treec9eb896c7ce7f346b58df8b22593a112f09f4124 /src/cow_http_hd.erl
parent49d63e6bd880b74220038539ad3503253140314f (diff)
downloadcowlib-bdad83a2abc9da946ad95ef1c3c030a3b2b706ea.tar.gz
cowlib-bdad83a2abc9da946ad95ef1c3c030a3b2b706ea.tar.bz2
cowlib-bdad83a2abc9da946ad95ef1c3c030a3b2b706ea.zip
Make sure tokens are non-empty in cow_http_hd
Diffstat (limited to 'src/cow_http_hd.erl')
-rw-r--r--src/cow_http_hd.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cow_http_hd.erl b/src/cow_http_hd.erl
index ba640e0..fac9c86 100644
--- a/src/cow_http_hd.erl
+++ b/src/cow_http_hd.erl
@@ -205,7 +205,7 @@ media_range_before_param(<< C, R/bits >>, Acc, T, S, P) when ?IS_TOKEN(C) ->
end.
media_range_param(<< $=, $", R/bits >>, Acc, T, S, P, K) -> media_range_quoted(R, Acc, T, S, P, K, <<>>);
-media_range_param(<< $=, R/bits >>, Acc, T, S, P, K) -> media_range_value(R, Acc, T, S, P, K, <<>>);
+media_range_param(<< $=, C, R/bits >>, Acc, T, S, P, K) when ?IS_TOKEN(C) -> media_range_value(R, Acc, T, S, P, K, << C >>);
media_range_param(<< C, R/bits >>, Acc, T, S, P, K) when ?IS_TOKEN(C) ->
case C of
?INLINE_LOWERCASE(media_range_param, R, Acc, T, S, P, K)
@@ -269,7 +269,7 @@ accept_ext(<< $;, R/bits >>, Acc, T, S, P, Q, E, K) -> accept_before_ext(R, Acc,
accept_ext(<< $\s, R/bits >>, Acc, T, S, P, Q, E, K) -> accept_before_semicolon(R, Acc, T, S, P, Q, [K|E]);
accept_ext(<< $\t, R/bits >>, Acc, T, S, P, Q, E, K) -> accept_before_semicolon(R, Acc, T, S, P, Q, [K|E]);
accept_ext(<< $=, $", R/bits >>, Acc, T, S, P, Q, E, K) -> accept_quoted(R, Acc, T, S, P, Q, E, K, <<>>);
-accept_ext(<< $=, R/bits >>, Acc, T, S, P, Q, E, K) -> accept_value(R, Acc, T, S, P, Q, E, K, <<>>);
+accept_ext(<< $=, C, R/bits >>, Acc, T, S, P, Q, E, K) when ?IS_TOKEN(C) -> accept_value(R, Acc, T, S, P, Q, E, K, << C >>);
accept_ext(<< C, R/bits >>, Acc, T, S, P, Q, E, K) when ?IS_TOKEN(C) ->
case C of
?INLINE_LOWERCASE(accept_ext, R, Acc, T, S, P, Q, E, K)
@@ -1741,7 +1741,7 @@ media_charset(<< C, R/bits >>, T, S, P, V) when ?IS_TOKEN(C) ->
end.
media_param(<< $=, $", R/bits >>, T, S, P, K) -> media_quoted(R, T, S, P, K, <<>>);
-media_param(<< $=, R/bits >>, T, S, P, K) -> media_value(R, T, S, P, K, <<>>);
+media_param(<< $=, C, R/bits >>, T, S, P, K) when ?IS_TOKEN(C) -> media_value(R, T, S, P, K, << C >>);
media_param(<< C, R/bits >>, T, S, P, K) when ?IS_TOKEN(C) ->
case C of
?INLINE_LOWERCASE(media_param, R, T, S, P, K)