-
-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Labels
status/needs-triageIssues that need to be triaged.Issues that need to be triaged.type/documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Description
webauthn/webauthn/example_passkey_test.go
Lines 112 to 121 in 16a1b65
| 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status/needs-triageIssues that need to be triaged.Issues that need to be triaged.type/documentationImprovements or additions to documentationImprovements or additions to documentation