       iex> "HTTP/1.1 204 No Content\\r\\nfo"
       ...> |> Raxx.HTTP1.parse_response()
       {:more, :undefined}
+
+      iex> "!!!BAD_STATUS_LINE\\r\\n"
+      ...> |> Raxx.HTTP1.parse_response()
+      {:error, {:invalid_line, "!!!BAD_STATUS_LINE\\r\\n"}}
+
+      iex> "HTTP/1.1 204 No Content\\r\\n!!!BAD_HEADER\\r\\n\\r\\n"
+      ...> |> Raxx.HTTP1.parse_response()
+      {:error, {:invalid_line, "!!!BAD_HEADER\\r\\n"}}
   """
   def parse_response(buffer) do
     case :erlang.decode_packet(:http_bin, buffer, []) do

    end
  end

  defp start_line(%Raxx.Request{method: method, raw_path: path, query: query}) do
    query_string = if query, do: ["?", query], else: ""
    [Atom.to_string(method), " ", path, query_string, " HTTP/1.1", @crlf]
  end

  defp response_line(%Raxx.Response{status: status}) do
    [
      "HTTP/1.1 ",
      Integer.to_string(status),

    headers =
      [{"host", request.authority}] ++ connection_headers ++ payload_headers ++ request.headers

    head = [request_line(request), header_lines(headers), @crlf]
    {head, body}
  end

