Skip to content

urlapi: forbid '|' in host#21762

Closed
tiymat wants to merge 1 commit into
curl:masterfrom
tiymat:fix-pipe
Closed

urlapi: forbid '|' in host#21762
tiymat wants to merge 1 commit into
curl:masterfrom
tiymat:fix-pipe

Conversation

@tiymat

@tiymat tiymat commented May 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #21744

Added | to the list of characters that cause an error in hostname_check, added a test to cover it.

@github-actions github-actions Bot added the tests label May 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds | to the deny-list of characters disallowed in hostnames by hostname_check() in the URL API, fixing issue #21744 where http://a|b/ was incorrectly accepted. Per RFC 3986, | is not valid in reg-name, IP-literal, or IPv4address.

Changes:

  • Add | to the strcspn deny-list in hostname_check().
  • Add a test case https://exam|ple.net expecting CURLUE_BAD_HOSTNAME in lib1560.c.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
lib/urlapi.c Adds `
tests/libtest/lib1560.c Adds a test case verifying that `

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

@bagder bagder closed this in a8e6f90 May 27, 2026
@bagder

bagder commented May 27, 2026

Copy link
Copy Markdown
Member

Thanks!

outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
dkarpov1970 pushed a commit to dkarpov1970/curl that referenced this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

Pipe character allowed in host.

3 participants