Closed dentot closed 9 years ago
Hey guys,
Still new with github, so pardon my ignorance.
I have a use case wherein input url doesn't contain schema, and was wondering if 'FlagForceHTTP' should also include adding default 'http' schema if schema doesn't exist, and not just if schema is 'https'? e.g. :
&testCase{ "ForceHTTP", "whereareyou.com", FlagForceHTTP, "http://whereareyou.com", false, },
Already made changes here in my local, and if this is a valid issue, should just be a simple fix, and will search on how to commit the change.
func forceHTTP(u *url.URL) { if strings.ToLower(u.Scheme) == "https" { u.Scheme = "http" }
// +den // for those urls not having schema, then add http if strings.ToLower(u.Scheme) == "" { u.Scheme = "http" } // -den
}
Hi,
This looks like a duplicate of #11, the feature makes sense but there are some subtle issues as mentioned in the discussion.
Thanks, Martin
Hey guys,
Still new with github, so pardon my ignorance.
I have a use case wherein input url doesn't contain schema, and was wondering if 'FlagForceHTTP' should also include adding default 'http' schema if schema doesn't exist, and not just if schema is 'https'? e.g. :
Already made changes here in my local, and if this is a valid issue, should just be a simple fix, and will search on how to commit the change.
func forceHTTP(u *url.URL) { if strings.ToLower(u.Scheme) == "https" { u.Scheme = "http" }
}