-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: createActionURL
set detectedProtocol correctly
#10421
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@Carlos-err406 is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
Could you add a test for it? Thanks for catching! |
URL.protocol always ends with colon: https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol |
will do! |
@ThangHuuVu what do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests pass, LGTM 👍
Althoguh it looks like x-forwarded-proto
is usually sent without :
(https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto), but shuold work either way.
createActionURL
set detectedProtocol correctly
true, there is a test that could be erased |
@Carlos-err406 could you please apply the tests changes suggested, as |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10421 +/- ##
=======================================
Coverage 39.48% 39.48%
=======================================
Files 171 171
Lines 27320 27321 +1
Branches 1168 1169 +1
=======================================
+ Hits 10786 10787 +1
Misses 16534 16534 ☔ View full report in Codecov by Sentry. |
…js#10421) * fix: possible invalid url in createActionURL * fix: x-forwarded-proto goes without colon
…js#10421) * fix: possible invalid url in createActionURL * fix: x-forwarded-proto goes without colon
☕️ Reasoning
the newest implementation of
createActionURL
occasionally throws ERR_INVALID_URL because of double colons in protocolthis fix just checks if the detectedProtocol ends with a colon, and if not it adds it before creating the url with the detected host
🧢 Checklist
🎫 Affected issues
Fixes: #10408
📌 Resources