mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 15:07:55 +00:00
prober: correct content-type response (#15989)
Content-type was responding as test/plain for probes accepting application/json. Set content type header before setting the response code to correct this. Updates tailscale/corp#27370 Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com>
This commit is contained in:
@@ -598,6 +598,9 @@ func TestProberRunHandler(t *testing.T) {
|
||||
}
|
||||
|
||||
if reqJSON {
|
||||
if w.Header().Get("Content-Type") != "application/json" {
|
||||
t.Errorf("unexpected content type: got %q, want application/json", w.Header().Get("Content-Type"))
|
||||
}
|
||||
var gotJSON RunHandlerResponse
|
||||
if err := json.Unmarshal(w.Body.Bytes(), &gotJSON); err != nil {
|
||||
t.Fatalf("failed to unmarshal JSON response: %v; body: %s", err, w.Body.String())
|
||||
|
Reference in New Issue
Block a user