MCPcopy
hub / github.com/getsops/sops / start

Method start

version/version_test.go:241–261  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

239}
240
241func (m *mockServer) start() *httptest.Server {
242 redirectIndex := 0
243
244 return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
245 if redirectIndex < len(m.redirectChain) {
246 redirectStatusCode := m.redirectChain[redirectIndex]
247 redirectIndex++
248
249 w.Header().Set("Location", "/redirected")
250 w.WriteHeader(redirectStatusCode)
251 return
252 }
253
254 for key, values := range m.header {
255 w.Header()[key] = values
256 }
257 w.Header().Set("Content-Type", "application/json")
258 w.WriteHeader(m.statusCode)
259 fmt.Fprintln(w, m.response)
260 }))
261}

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected