Skip to content
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

lib: Prefix URLs with lower-case protocol names/schemes #597

Closed
wants to merge 2 commits into from
Closed

lib: Prefix URLs with lower-case protocol names/schemes #597

wants to merge 2 commits into from

Conversation

MoSal
Copy link
Contributor

@MoSal MoSal commented Jan 8, 2016

Before this patch, if a URL does not start with the protocol
name/scheme, effective URLs would be prefixed with upper-case
protocol names/schemes. This behavior might not be expected by
library users or end users.

For example, if CURLOPT_DEFAULT_PROTOCOL is set to "https". And
the URL is "hostname/path". The effective URL would be
"HTTPS://hostname/path" instead of "https://hostname/path".

After this patch, effective URLs would be prefixed with
a lower-case protocol name/scheme.

@bagder
Copy link
Member

bagder commented Jan 10, 2016

I think the suggestion is good. But why not sprintf() the new string first and then lower case the protocol part within that, then you won't have to copy the protocol first into a fixed-sized array?

@bagder bagder self-assigned this Jan 10, 2016
  Before this patch, if a URL does not start with the protocol
  name/scheme, effective URLs would be prefixed with upper-case
  protocol names/schemes. This behavior might not be expected by
  library users or end users.

  For example, if `CURLOPT_DEFAULT_PROTOCOL` is set to "https". And
  the URL is "hostname/path". The effective URL would be
  "HTTPS://hostname/path" instead of "https://hostname/path".

  After this patch, effective URLs would be prefixed with
  a lower-case protocol name/scheme.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
@MoSal
Copy link
Contributor Author

MoSal commented Jan 11, 2016

I think the suggestion is good. But why not sprintf() the new string first and then lower case the protocol part within that, then you won't have to copy the protocol first into a fixed-sized array?

Done.

@bagder bagder closed this in 3d209b5 Jan 11, 2016
@bagder
Copy link
Member

bagder commented Jan 11, 2016

Thanks!

@MoSal MoSal deleted the lower_case_proto branch January 11, 2016 23:15
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants