-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to specify default scheme #296
Comments
Maybe, instead of this, there could be a set-if-not-set syntax e.g. |
I started working on @emanuele6's proposal only to run into a minor issue: When we parse a URL without a scheme, we must ask libcurl to guess the scheme because otherwise it does not accept the URL. When it guesses a scheme, it sets that for the URL and when we subsequently check the URL we can no longer figure out if the scheme is the result of a guess or not. Therefore, we can't after the fact replace the scheme if it was not previously set, because we no longer have the information if the scheme was guessed or not. All other parts of the URL can be polled if it exists or not before setting it again, and I will soon make a PR for that change. I have created curl/curl#13616 for curl, to allow us to query the URL proper if the set scheme was guessed or set. But that will take a little while until it lands there. |
… set Idea-by: @emanuele6 in #296 Due to missing support in the libcurl URL API, this is not really working for the scheme component right now, as that will always be considered set once a URL has been parsed. The scheme guessing the parser thus sets it internally and there is currently no way provided by the API to figure that out.
Idea-by: @emanuele6 in #296 Due to missing support in the libcurl URL API, this is not really working for the scheme component right now, as that will always be considered set once a URL has been parsed. The scheme guessing the parser does sets it internally and there is currently no way provided by the API to figure that out.
Idea-by: @emanuele6 in #296 Due to missing support in the libcurl URL API, this is not really working for the scheme component right now, as that will always be considered set once a URL has been parsed. The scheme guessing the parser does sets it internally and there is currently no way provided by the API to figure that out. When the URL API has been extended, we can expand this functionality for working better with scheme. Closes #298
|
For now the default scheme seems to be coming from libcurl, which
is typically 'http'. It could be useful to override it to something else,
such as 'https' to get secure-by-default URLs.
E.g. with
--default-scheme https
.trurl --url example.org → http://example.org/
trurl --url example.org --default-scheme https → https://example.org/
The text was updated successfully, but these errors were encountered: