Skip to content

Commit bbbb064

Browse files
committed
Add guards to media_type
Closes #1180.
1 parent 4088bc4 commit bbbb064

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/plug/conn/utils.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ defmodule Plug.Conn.Utils do
5252
5353
"""
5454
@spec media_type(binary) :: {:ok, type :: binary, subtype :: binary, params} | :error
55-
def media_type(binary) do
55+
def media_type(binary) when is_binary(binary) do
5656
case strip_spaces(binary) do
5757
"*/*" <> t -> mt_params(t, "*", "*")
5858
t -> mt_first(t, "")

0 commit comments

Comments
 (0)