Skip to content

Fixes forwarding https URLs on mac#1768

Merged
garrytrinder merged 1 commit into
dotnet:nextfrom
waldekmastykarz:fix-urls-mac
Jul 20, 2026
Merged

Fixes forwarding https URLs on mac#1768
garrytrinder merged 1 commit into
dotnet:nextfrom
waldekmastykarz:fix-urls-mac

Conversation

@waldekmastykarz

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 the Kestrel proxy connection handler’s parsing/validation of absolute-form request targets, presumably to improve reliability when forwarding requests that arrive with an https:// absolute URL (notably on macOS system-proxy clients).

Changes:

  • Tighten request-target validation by requiring an absolute URI and restricting allowed URI schemes (currently http/https only).

Comment on lines +281 to 285
if (!Uri.TryCreate(absoluteUrl, UriKind.Absolute, out var requestUri)
|| (requestUri.Scheme != "http" && requestUri.Scheme != "https"))
{
await WriteErrorAsync(clientStream, HttpStatusCode.BadRequest, "Malformed request target", ct).ConfigureAwait(false);
return false;
@garrytrinder
garrytrinder merged commit 6da909f into dotnet:next Jul 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants