mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
20 lines
420 B
Go
20 lines
420 B
Go
package testing
|
|
|
|
import "net/http"
|
|
|
|
type RecordingServer struct {
|
|
Entries []string
|
|
}
|
|
|
|
func NewRecordingServer() *RecordingServer {
|
|
return &RecordingServer{}
|
|
}
|
|
|
|
func (s *RecordingServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
s.Entries = append(s.Entries, r.URL.Path)
|
|
|
|
w.WriteHeader(http.StatusOK)
|
|
w.Header().Set("Content-Type", "application/json")
|
|
w.Write([]byte(`{"test":true}`)) //nolint:errcheck
|
|
}
|