MCPcopy Create free account
hub / github.com/PascalMinder/geoblock / ServeHTTP

Method ServeHTTP

geoblock_test.go:1409–1416  ·  view source on GitHub ↗
(w http.ResponseWriter, _ *http.Request)

Source from the content-addressed store, hash-verified

1407}
1408
1409func (h *CountryCodeHandler) ServeHTTP(w http.ResponseWriter, _ *http.Request) {
1410 w.WriteHeader(http.StatusOK)
1411
1412 _, err := w.Write([]byte(h.ResponseCountryCode))
1413 if err != nil {
1414 fmt.Println("Error on write")
1415 }
1416}
1417
1418func apiHandlerInvalid(w http.ResponseWriter, _ *http.Request) {
1419 fmt.Fprintf(w, "Invalid Response")

Calls

no outgoing calls

Tested by

no test coverage detected