fix: handle upper case protocol like HTTP or HTTPS#1805
Merged
fengmk2 merged 3 commits intokoajs:masterfrom Mar 21, 2024
Merged
fix: handle upper case protocol like HTTP or HTTPS#1805fengmk2 merged 3 commits intokoajs:masterfrom
fengmk2 merged 3 commits intokoajs:masterfrom
Conversation
fix pull 1804 when url like HTTP or HTTPS
fix pull 1804 when url like HTTP or HTTPS
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1805 +/- ##
=======================================
Coverage 98.66% 98.66%
=======================================
Files 5 5
Lines 525 525
Branches 147 147
=======================================
Hits 518 518
Misses 7 7 ☔ View full report in Codecov by Sentry. |
Contributor
Author
fengmk2
reviewed
Mar 21, 2024
| // location | ||
| if (url === 'back') url = this.ctx.get('Referrer') || alt || '/' | ||
| if (url.startsWith('https://') || url.startsWith('http://')) { | ||
| if (/^https?:\/\//i.test(url)) { |
Member
There was a problem hiding this comment.
@FDrag0n I change to use Regex to avoid lowerCase twice.
Contributor
Author
There was a problem hiding this comment.
It's a nice change👍
fengmk2
added a commit
that referenced
this pull request
Mar 21, 2024
Co-authored-by: fengmk2 <suqian.yf@antgroup.com>
fengmk2
added a commit
that referenced
this pull request
Mar 21, 2024
pick from #1805 Co-authored-by: FDrag0n <34733637+FDrag0n@users.noreply.github.com>
etroynov
pushed a commit
to etroynov/koa
that referenced
this pull request
Apr 1, 2024
Co-authored-by: fengmk2 <suqian.yf@antgroup.com>
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.
#1800 's fix #1804 forgot to consider the case where url is uppercase HTTP and HTTPS