           raw_path: "/path",
           scheme: :http
         }, :keepalive, {:complete, ""}, ""}}
+
+      # Test line_length is limited
+      # "GET /" +  "HTTP/1.1\\r\\n" = 15
+      iex> path = "/" <> String.duplicate("a", 985)
+      ...> "GET \#{path} HTTP/1.1\\r\\n"
+      ...> |> Raxx.HTTP1.parse_request(scheme: :http)
+      {:error, {:line_length_limit_exceeded, :request_line}}
+
+      iex> path = "/" <> String.duplicate("a", 984)
+      ...> {:more, _} = "GET \#{path} HTTP/1.1\\r\\n"
+      ...> |> Raxx.HTTP1.parse_request(scheme: :http)
+      ...> :ok
+      :ok
+
+      iex> path = "/" <> String.duplicate("a", 1984)
+      ...> {:more, _} = "GET \#{path} HTTP/1.1\\r\\n"
+      ...> |> Raxx.HTTP1.parse_request(scheme: :http, line_length_limit: 2000)
+      ...> :ok
+      :ok
+
+      iex> "GET / HTTP/1.1\\r\\nhost: \#{String.duplicate("a", 993)}\\r\\n"
+      ...> |> Raxx.HTTP1.parse_request(scheme: :http)
+      {:error, {:line_length_limit_exceeded, :header_line}}
+
+      iex> {:more, _} = "GET / HTTP/1.1\\r\\nhost: \#{String.duplicate("a", 992)}\\r\\n"
+      ...> |> Raxx.HTTP1.parse_request(scheme: :http)
+      ...> :ok
+      :ok
+
+      iex> {:more, _} = "GET / HTTP/1.1\\r\\nhost: \#{String.duplicate("a", 1992)}\\r\\n"
+      ...> |> Raxx.HTTP1.parse_request(scheme: :http, line_length_limit: 2000)
+      ...> :ok
+      :ok
   """
-  @spec parse_request(binary, atom) ::
+  @spec parse_request(binary, [option]) ::
           {:ok, {Raxx.Request.t(), connection_status, body_read_state, binary}}
           | {:error, term}
           | {:more, :undefined}
-  def parse_request(buffer, scheme) when is_atom(scheme) do
-    case :erlang.decode_packet(:http_bin, buffer, []) do
+        when option: {:scheme, atom} | {:line_length_limit, integer}
+  def parse_request(buffer, options) do
+    scheme = Keyword.get(options, :scheme)
+    line_length_limit = Keyword.get(options, :line_length_limit, 1_000)
+
+    case :erlang.decode_packet(:http_bin, buffer, line_length: line_length_limit) do
       {:ok, {:http_request, method, {:abs_path, path_and_query}, _version}, rest} ->
-        case parse_headers(rest) do
+        case parse_headers(rest, line_length_limit: line_length_limit) do
           {:ok, headers, rest2} ->
             case Enum.split_with(headers, fn {key, _value} -> key == "host" end) do
               {[{"host", host}], headers} ->

      {:ok, {:http_error, invalid_line}, _rest} ->
        {:error, {:invalid_line, invalid_line}}

      {:more, :undefined} ->
        {:more, buffer}
    end
  end

  defp parse_headers(buffer, headers \\ []) do
    case :erlang.decode_packet(:httph_bin, buffer, []) do
      {:ok, :http_eoh, rest} ->
        {:ok, Enum.reverse(headers), rest}

      {:ok, {:http_header, _, key, _, value}, rest} ->
        parse_headers(rest, [{String.downcase("#{key}"), value} | headers])

      {:ok, {:http_error, invalid_line}, _rest} ->
        {:error, {:invalid_line, invalid_line}}

      {:more, :undefined} ->
        {:more, :undefined}

       }, nil, {:complete, ""}, ""}}

      iex> "GET /path?qs HTTP/1.1\\r\\nhost: example.com\\r\\naccept: text/plain\\r\\n\\r\\n"
      ...> |> Raxx.HTTP1.parse_request(scheme: :https)
      {:ok,
       {%Raxx.Request{
         authority: "example.com",
