MCPcopy
hub / github.com/syncthing/syncthing / handler

Method handler

lib/discover/global_test.go:227–240  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

225}
226
227func (s *fakeDiscoveryServer) handler(w http.ResponseWriter, r *http.Request) {
228 if r.URL.Path == "/block" {
229 // Never return for requests here
230 select {}
231 }
232
233 if r.Method == "POST" {
234 s.announce, _ = io.ReadAll(r.Body)
235 w.WriteHeader(204)
236 } else {
237 w.Header().Set("Content-Type", "application/json")
238 w.Write([]byte(`{"addresses":["tcp://192.0.2.42::22000"], "relays":[{"url": "relay://192.0.2.43:443", "latency": 42}]}`))
239 }
240}
241
242type fakeAddressLister struct{}
243

Callers

nothing calls this directly

Calls 4

WriteHeaderMethod · 0.45
SetMethod · 0.45
HeaderMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected