Repository navigation
Refuse joins whose url has no host instead of crashing - #4490
Merged
SteffenDE merged 1 commit intoNov 5, 2026
Merged
Conversation
A join with a "url" or "redirect" that parses without a host (for example "" or a relative path) can still match an internal route in the same live session. verified_mount/8 then raised a CaseClauseError, since its byte_size(host) guard fails on nil and there is no fallback clause. Treat such urls as unmatched so the join is refused as unauthorized. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013C832oaAyjJ711i9QTCVjR
Merged
Member
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If a join's
urlorredirectparses to a URI with no host, the LiveView channel crashes with aCaseClauseErrorinverified_mount/8. This happens with""or a relative path such as"clock-live-session".session_route/3still resolves such a URL to an internal route. When that route is in the same live session,authorize_session/3accepts it. Then this code runs:byte_size(nil)fails the guard, and there is no fallback clause.In production we see this from Meta's crawler. On live navigation it sends
"redirect" => "", presumably because its DOM doesn't resolveanchor.hrefto an absolute URL. We logged several hundred of these crashes in two weeks. This may also be the server side of #2518.Change
session_route/3now returnsnilfor routes whose URI has no host. The join is refused asunauthorized, so the client falls back to a full page load. That's the same path as navigating to a route in a different live session.Test
Added
"refused with a url without host"to thelive_redirecttests innavigation_test.exs. It fails with theCaseClauseErrorbefore the change and passes after it. The full suite passes.🤖 Generated with Claude Code