Skip to content

Allow empty authority for unknown schemes - #4349

Closed
ghost wants to merge 6 commits into
masterfrom
unknown repository
Closed

ghost wants to merge 6 commits into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Sep 13, 2019

Copy link
Copy Markdown

I discussed this briefly with @bagder

According to RFC3986 Section 3.2.2 on page 21

If the URI scheme defines a default for host, then that default
applies when the host subcomponent is undefined or when the
registered name is empty (zero length). For example, the "file" URI
scheme is defined so that no authority, an empty host, and
"localhost" all mean the end-user's machine, whereas the "http"
scheme considers a missing authority or empty host invalid.

cURL implements this behaviour for the file scheme, but doesn't - and cannot - implement this behaviour for schemes it does not know. For such schemes, passing a new flag that permits empty authority sections is desirable.

This PR adds such a CURLU_NO_AUTHORITY flag, as well as test cases.

Jens Finkhaeuser added 3 commits September 13, 2019 17:36
for use with unknown schemes (i.e. not "file:///") to override cURL's
demand that an authority exists.
parts should fail. With it, it should work. The flag effectively
disables the hostname check if it's set, and the hostname is empty.
@bagder bagder added the URL label Sep 13, 2019
@ghost

ghost commented Sep 13, 2019

Copy link
Copy Markdown
Author

I've got to run - if there are tests failing, or there should be changes, I'll look at them in a few days, probably. Locally everything looked fine. And obviously if you'd like changes, I'm happy to provide them.

@bagder

bagder commented Sep 13, 2019

Copy link
Copy Markdown
Member

I think this is a sensible way to make the parser handle such URLs so I'm in favor of merging once things are green. Still missing: documentation of the new flag and symbols-in-versions update.

@ghost

ghost commented Sep 15, 2019

Copy link
Copy Markdown
Author

Makes sense - will probably get to those changes tomorrow.

@bagder

bagder commented Sep 15, 2019 •

Copy link
Copy Markdown
Member

The two builds using boringssl fail due to other reasons, not your fault!

@ghost

ghost commented Sep 15, 2019

Copy link
Copy Markdown
Author

Excellent, then let me know if you want any other changes, otherwise I'm done.

@bagder bagder left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will merge asap!

@bagder bagder closed this in 0a4ecbd Sep 19, 2019
@bagder

bagder commented Sep 19, 2019

Copy link
Copy Markdown
Member

Thanks!

@ghost

ghost commented Sep 19, 2019

Copy link
Copy Markdown
Author

No worries, glad to be of help!

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

1 participant