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
base: master
from

Conversation

Projects
None yet
2 participants
@MoSal
Contributor

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

This comment has been minimized.

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

MoSal added some commits Jan 8, 2016

lib: Prefix URLs with lower-case protocol names/schemes
  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

This comment has been minimized.

Contributor

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

This comment has been minimized.

Member

bagder commented Jan 11, 2016

Thanks!

@MoSal MoSal deleted the saldl:lower_case_proto branch Jan 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment