gateway: the extension socket's test takes a 401 from the LAN guard as refused
TestBrowserExtensionOnlyFromItsOrigin (0e9057227) wanted 403 for every case. On Linux the other computer's try is answered by the LAN guard first, 401 for no key, before the handler's 403; it is refused either way, never switched to a WebSocket. Found by the full suite in magpie-desktop after the push. Run: go test ./internal/gateway -run Browser on mote (macOS) and in magpie-desktop (Linux, -tags nogui), both ok. The rest of that Linux full run at0565c0bba: ., internal/cli ok with -tags nogui; reds that fail the same at origin/mainf9ca3dd44or are filed: internal/agent's install tests (#4033, #3548), TestSettingsSaveKeepsWhatItDoesNotSend (#4514), TestColdTurnsTaken, ok alone (#4510).
This commit is contained in:
@@ -214,7 +214,9 @@ func TestBrowserExtensionOnlyFromItsOrigin(t *testing.T) {
|
||||
}
|
||||
w := httptest.NewRecorder()
|
||||
h.ServeHTTP(w, r)
|
||||
if w.Code != http.StatusForbidden {
|
||||
// refused, by the LAN guard (401 for a computer sending no key) or
|
||||
// by the handler (403): never switched to a WebSocket
|
||||
if w.Code != http.StatusForbidden && w.Code != http.StatusUnauthorized {
|
||||
t.Fatalf("%+v: %d %s", c, w.Code, w.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user