test1675: unit tests for URL API helper functions#21296
Conversation
|
Analysis of PR #21296 at d531aa40: Test 1675 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 62 different CI jobs (the link just goes to one of them). Test 350 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 2 different CI jobs (the link just goes to one of them). Generated by Testclutch |
There was a problem hiding this comment.
Pull request overview
Adds/extends URL API unit test coverage for internal URL helper routines and updates URL encoding/file URL parsing behavior to match new expectations (notably: normalize percent-encoding hex to uppercase and reject non-local file://<hostname>/...).
Changes:
- Add new unit test suite
unit1675coveringipv4_normalize,urlencode_str,ipv6_parse, andparse_file. - Update
urlencode_strto normalize percent-encoded hex to uppercase and adjust whitespace handling logic. - Tighten
file://URL parsing expectations (treat non-local hostnames asCURLUE_BAD_FILE_URL) and update existing tests accordingly.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/unit1675.c | New unit test coverage for URL API helper functions. |
| tests/unit/Makefile.inc | Registers unit1675.c in the unit test build. |
| lib/urlapi.c | Exposes helpers for unit tests, normalizes percent-encoding to uppercase, and changes parse_file behavior/signature. |
| lib/urlapi-int.h | Moves internal struct Curl_URL + HOST_* constants into internal header for shared use. |
| tests/libtest/lib1560.c | Updates expected result for non-local file://host... to CURLUE_BAD_FILE_URL. |
| tests/data/test58 | Updates expected request path to uppercase percent-encoding (%5B%5D). |
| tests/data/test1675 | Adds new test definition to run the new unit test. |
| tests/data/Makefile.am | Registers test1675. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
augment review |
🤖 Augment PR SummarySummary: This PR expands URL API unit coverage and tightens URL-encoding normalization. Changes:
Technical Notes: The encoding normalization is implemented by detecting valid 🤖 Was this summary useful? React with 👍 or 👎 |
- ipv4_normalize - urlencode_str - ipv6_parse - parse_file urlapi: make the string URL encoder normalize to uppercase percent-encoding
There is no reason we should treat this part different on Windows. Noe anything except blank, localhost or 127.0.0.1 cause error there as well.
Since we can't use the hostname for anything it is misleading
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There is no reason we should treat this part different on Windows. Noe anything except blank, localhost or 127.0.0.1 cause error there as well. Also: fix query handling in urlencode_str Closes #21296
urlapi: make the string URL encoder normalize to uppercase percent-encoding