Skip to content

414 returned for large query string #4293

Description

@acco

Environment

  • Elixir version (elixir -v): 1.11.3
  • Phoenix version (mix deps): 1.5.8
  • Operating system: macOS Big Sur 11.1

Expected behavior

When making a curl request with a large query string (>10,000 bytes), the request succeeds.

Actual behavior

Request fails with:

> Host: localhost:4000
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 414 Request-URI Too Long
< connection: close
< content-length: 0
<
* Closing connection 0

I thought this may have been happening in Plug.Parsers.fetch_query_params/x but (a) that function has a default limit of 1M bytes and (b) I can prove that function is never called.

I made this example repo where the first plug called in Endpoint prints a "HERE" and halts. Alas, the response is the same (414) and there is no indication that this plug is invoked. Therefore, I have reason to suspect the 414 is coming higher up in the chain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions