Description
|
encoder := json.NewEncoder(rw) |
|
|
|
if err = encoder.Encode(creation); err != nil { |
|
rw.WriteHeader(http.StatusInternalServerError) |
|
|
|
return |
|
} |
|
|
|
rw.Header().Set("Content-Type", "application/json; charset=utf-8") |
|
rw.WriteHeader(http.StatusOK) |
https://pkg.go.dev/net/http#ResponseWriter
WriteHeader() should be called before Write(), not after. Cannot write headers once the body has been written. In the other examples as well.
Additional Information
No response
Description
webauthn/webauthn/example_passkey_test.go
Lines 112 to 121 in 16a1b65
https://pkg.go.dev/net/http#ResponseWriter
WriteHeader() should be called before Write(), not after. Cannot write headers once the body has been written. In the other examples as well.
Additional Information
No response