Phoenix.LiveDashboard.RequestLogger does not respect Plug.Parsers `validate_utf8: false`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- elixir
- Domain
- backend, observability
Research direction
Start at lib/phoenix/live_dashboard/request_logger.ex around line 35 and inspect its call to Plug.Conn.fetch_query_params/2 alongside the linked Plug.Parsers behavior. Confirm that requests with non-UTF-8 query parameters and validate_utf8: false no longer raise through the request logger, and add or update relevant coverage if present.
Written by the indexing model from the issue text.
Description
Related: https://github.com/phoenixframework/phoenix_live_dashboard/issues/470, https://github.com/elixir-plug/plug/issues/925
I apologize for the title, I'm not sure exactly what this should be called.
I have an endpoint that needs to receive non-UTF-8 query params. Thankfully, there is the validate_utf8: false option that I can set on Plug.Parsers, so thank you for that.
However, I get errors like [debug] ** (Plug.Conn.InvalidQueryError) invalid UTF-8 on urlencoded params, got byte 159 when the Phoenix.LiveDashboard.RequestLogger plug is enabled, even when Plug.Parsers validate_utf8 is set to false.
When enabled in Phoenix's endpoint.ex (which it is by default), the Phoenix.LiveDashboard.RequestLogger plug appears to call Plug.Conn.fetch_query_params/2 with the default options here, which have validate_utf8 set to true.
I can confirm that commenting out the Phoenix.LiveDashboard.RequestLogger plug causes the plug stack to no longer raise, so this is not a big deal, but I'm just reporting this because this may be slightly confusing to others who set Plug.Parsers validate_utf8: false and then continue to see the exception. I know this confused me: I set validate_utf8: false and my endpoint continued to crash for requests that had non-UTF-8 data, until I dug into the stack trace and saw that it wasn't coming from Plug.Parsers but was coming from Phoenix.LiveDashboard.RequestLogger.
Thank you!
- Dominant language
- Elixir
- Stars
- 2.2k
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from phoenixframework/phoenix_live_dashboard
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
phoenixframework/phoenix_live_dashboard#484 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Broken Links when using forward plugPossibly taken @yordis claimed this 1266 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
phoenixframework/phoenix_live_dashboard#417 · 2 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
phoenixframework/phoenix_live_dashboard#380 · 5 comments · 1 reaction ·
-
design
Difficulty 3/5 1-2 days Newbie friendliness 35/100
phoenixframework/phoenix_live_dashboard#343 · 4 comments ·
All issues in phoenixframework/phoenix_live_dashboard
Similar issues
-
Bug: Table layout and date column are cut off on mobile screens on the Tournaments -> History pageOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
hexlet-codebattle/codebattle#2375 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wintermeyer/vutuv#2388 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Broadcast API docs say to prepend realtime: to the topic, which breaks deliveryPossibly taken @mandar1045 claimed this 1 day ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
phoenixframework/phoenix_live_view#4509 ·
Maintainers usually reply within 1 day