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

Remove hardcoded https scheme and use appropriate scheme depending on environment. #2941

Open
2 tasks
DanielRyanSmith opened this issue Aug 19, 2022 · 0 comments · May be fixed by #3037
Open
2 tasks

Remove hardcoded https scheme and use appropriate scheme depending on environment. #2941

DanielRyanSmith opened this issue Aug 19, 2022 · 0 comments · May be fixed by #3037
Assignees

Comments

@DanielRyanSmith
Copy link
Contributor

DanielRyanSmith commented Aug 19, 2022

Background

There are places in the code where the url scheme is hardcoded to https. As a result, when a developer has all of the micro services up locally, the webapp micro service cannot call the search cache service because the scheme is hardcoded.

Definition of Done

  • Find all places of hardcoded with https and have it use the appropriate scheme depending on where it is deployed (locally or google cloud)
  • The microservices work together not only when deployed but locally.

Examples (not exhaustive)

Example 1:

wpt.fyi/api/query/search.go

Lines 165 to 166 in cee243f

// TODO(Issue #2941): This will not work when hostname is localhost (http scheme needed).
fwdURL, err := url.Parse(fmt.Sprintf("https://%s/api/search/cache", hostname))

Example 2:

url := "https://" + wptdHost + "/api/runs"
url += "?" + filter.OrDefault().ToQuery().Encode()

Example 3:

HostURL: fmt.Sprintf("https://%s/", host),

Example 4:

result, _ := url.Parse(fmt.Sprintf("https://%s%s", a.GetVersionedHostname(), "/api/results/upload"))

Example 5:

detailsURL, _ := url.Parse(fmt.Sprintf("https://%s%s", host, path))

Example 6:

detailsURL, _ := url.Parse(fmt.Sprintf("https://%s/results/", d.aeAPI.GetHostname()))

Example 7:

diffURL, _ := url.Parse(fmt.Sprintf("https://%s/api/search", d.aeAPI.GetVersionedHostname()))

Example 8:

CallbackURL: fmt.Sprintf("https://%s/api/results/create", a.GetVersionedHostname()),

Example 9:

callback := url.URL{Scheme: "https", Host: r.Host, Path: "oauth"}

@jcscottiii jcscottiii changed the title Search cache testing will not work when hostname is localhost (http scheme needed) Remove hardcoded https scheme and use appropriate scheme depending on environment. Sep 30, 2022
@jcscottiii jcscottiii self-assigned this Nov 22, 2022
@jcscottiii jcscottiii linked a pull request Nov 22, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants