Skip to content

urlapi: handle redirect without set scheme with default-scheme#21632

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/urlapi-null-scheme
Closed

urlapi: handle redirect without set scheme with default-scheme#21632
bagder wants to merge 1 commit into
masterfrom
bagder/urlapi-null-scheme

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented May 15, 2026

Reported-by: mulan_dh on hackerone

@testclutch
Copy link
Copy Markdown

Analysis of PR #21632 at a6650300:

Test 2402 failed, which has NOT been flaky recently, so there could be a real issue in this PR. Note that this test has failed in 12 different CI jobs (the link just goes to one of them). Note that this CI job has had a number of other flaky tests recently (2, to be exact) so it may be that this failure is rather a systemic issue with this job and not with this specific PR.

Generated by Testclutch

Comment thread tests/libtest/lib1921.c Outdated
@bagder bagder marked this pull request as ready for review May 15, 2026 14:13
@bagder bagder requested a review from Copilot May 15, 2026 14:13
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates URL API redirect handling so a relative redirect can be applied when the URL handle has no stored scheme but CURLU_DEFAULT_SCHEME is in use.

Changes:

  • Falls back to DEFAULT_SCHEME when computing redirect URL offsets if u->scheme is unset.
  • Adds a new libtest regression case for default-scheme redirects.
  • Registers the new test source and test data.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/urlapi.c Uses the default scheme when deriving the protocol separator during relative redirect handling.
tests/libtest/lib1921.c Adds a regression test for redirecting a URL handle without a stored scheme.
tests/libtest/Makefile.inc Adds lib1921.c to the libtest build list.
tests/data/test1921 Defines the new URL API regression test.
tests/data/Makefile.am Adds test1921 to the test data list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/libtest/lib1921.c
@bagder bagder force-pushed the bagder/urlapi-null-scheme branch 2 times, most recently from 99c399c to 94dda7f Compare May 15, 2026 22:57
bagder added a commit that referenced this pull request May 15, 2026
@bagder bagder force-pushed the bagder/urlapi-null-scheme branch from 94dda7f to 565e2e1 Compare May 15, 2026 22:57
@bagder bagder force-pushed the bagder/urlapi-null-scheme branch from 565e2e1 to a023bdc Compare May 15, 2026 22:59
@bagder bagder closed this in f9b9d3b May 16, 2026
@bagder bagder deleted the bagder/urlapi-null-scheme branch May 16, 2026 09:46
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Verify in test 1921

Reported-by: mulan_dh on hackerone

Closes curl#21632
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants