Skip to content

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

Closed
MoSal wants to merge 2 commits into
curl:masterfrom
saldl:lower_case_proto
Closed

MoSal wants to merge 2 commits into
curl:masterfrom
saldl:lower_case_proto

Conversation

@MoSal

@MoSal MoSal commented Jan 8, 2016

Copy link
Copy Markdown
Contributor

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

bagder commented Jan 10, 2016

Copy link
Copy Markdown
Member

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
MoSal added 2 commits January 11, 2016 02:18
  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

MoSal commented Jan 11, 2016

Copy link
Copy Markdown
Contributor Author

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

bagder commented Jan 11, 2016

Copy link
Copy Markdown
Member

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.

2 participants