MCPcopy
hub / github.com/syncthing/syncthing / TestHTTPOptions

Function TestHTTPOptions

test/http_test.go:127–143  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

125}
126
127func TestHTTPOptions(t *testing.T) {
128 p := startInstance(t, 2)
129 defer checkedStop(t, p)
130
131 req, err := http.NewRequest("OPTIONS", "http://127.0.0.1:8082/rest/system/error/clear", nil)
132 if err != nil {
133 t.Fatal(err)
134 }
135 res, err := http.DefaultClient.Do(req)
136 if err != nil {
137 t.Fatal(err)
138 }
139 res.Body.Close()
140 if res.StatusCode != 204 {
141 t.Fatalf("Status %d != 204 for OPTIONS", res.StatusCode)
142 }
143}
144
145func TestHTTPPOSTWithoutCSRF(t *testing.T) {
146 p := startInstance(t, 2)

Callers

nothing calls this directly

Calls 5

startInstanceFunction · 0.85
checkedStopFunction · 0.85
FatalMethod · 0.80
DoMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected