Skip to content

Commit 3f371f9

Browse files
authored
Revert "Redirect to bouncer with 307 (#92)" (#94)
This reverts commit 7828dfd.
1 parent de0e496 commit 3f371f9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

stubservice/stubhandlers/stubhandler_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func TestStubServiceErrorCases(t *testing.T) {
242242
recorder := fetchURL(`http://test/?product=firefox-stub&os=win&lang=en-US`)
243243
code := recorder.Code
244244
location := recorder.HeaderMap.Get("Location")
245-
if code != 307 || location != "https://download.mozilla.org/?lang=en-US&os=win&product=firefox-stub" {
245+
if code != 302 || location != "https://download.mozilla.org/?lang=en-US&os=win&product=firefox-stub" {
246246
t.Errorf("service did not return bouncer redirect status: %d loc: %s", code, location)
247247
}
248248
})
@@ -251,7 +251,7 @@ func TestStubServiceErrorCases(t *testing.T) {
251251
recorder := fetchURL(`http://test/?product=firefox-stub&os=win&lang=en-US&attribution_code=invalidcode`)
252252
code := recorder.Code
253253
location := recorder.HeaderMap.Get("Location")
254-
if code != 307 || location != "https://download.mozilla.org/?lang=en-US&os=win&product=firefox-stub" {
254+
if code != 302 || location != "https://download.mozilla.org/?lang=en-US&os=win&product=firefox-stub" {
255255
t.Errorf("service did not return bouncer redirect status: %d loc: %s", code, location)
256256
}
257257
})

stubservice/stubhandlers/stubservice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (s *stubService) ServeHTTP(w http.ResponseWriter, req *http.Request) {
3030

3131
redirectBouncer := func() {
3232
backupURL := bouncerURL(query.Get("product"), query.Get("lang"), query.Get("os"))
33-
http.Redirect(w, req, backupURL, http.StatusTemporaryRedirect)
33+
http.Redirect(w, req, backupURL, http.StatusFound)
3434
}
3535

3636
attributionCode := query.Get("attribution_code")

0 commit comments

Comments
 (0)