url same origin tests#21328
Closed
icing wants to merge 7 commits into
Closed
Conversation
Add new internal `curl_url_same_origin()` to check if a href has the same origin as a base URL. Add test cases in test1675 and use this in http2 push handling.
bagder
approved these changes
Apr 15, 2026
There was a problem hiding this comment.
Pull request overview
Adds an internal same-origin check for URLs and applies it to HTTP/2 server push handling to restrict PUSH_PROMISE resources to the same origin as the initiating request, with accompanying unit coverage.
Changes:
- Introduce
Curl_url_same_origin()in the URL API internals. - Use same-origin validation in HTTP/2 PUSH_PROMISE URL construction.
- Add unit tests in
unit1675and updatesingleuse.plallowlist.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
lib/urlapi.c |
Adds Curl_url_same_origin() implementation. |
lib/urlapi-int.h |
Exposes Curl_url_same_origin() for internal callers. |
lib/http2.c |
Enforces same-origin requirement for pushed resources when forming the transfer URL. |
tests/unit/unit1675.c |
Adds unit test cases covering same-origin matching behavior. |
scripts/singleuse.pl |
Attempts to allowlist the new internal symbol for single-use scanning. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
working on making test_05_09 more reliable here: #21337 |
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.
Add new internal
curl_url_same_origin()to check if a href has the same origin as a base URL. Add test cases in test1675 and use this in http2 push handling.