Skip to content

Confusing error message in presence of backslashes in url #22337

Description

@kit-ty-kate

I did this

A bug in the code i'm working on transformed / in \ in urls before passing it to curl. However the error message displayed by curl was rather perplexing and didn't help to debug the root issue properly

$ curl 'http://localhost:1111\test'
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
$ curl 'http:\\localhost:1111'
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
$ curl 'http:\\localhost'
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535

I expected the following

I think it would help to at least display what was parsed as a number

curl/libcurl version

curl 8.18.0

operating system

Tested on both Linux and Windows

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions