mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
chore: add derpserver to wsproxy, add proxies to derpmap (#7311)
This commit is contained in:
@ -151,11 +151,9 @@ func Write(ctx context.Context, rw http.ResponseWriter, status int, response int
|
||||
enc := json.NewEncoder(rw)
|
||||
enc.SetEscapeHTML(true)
|
||||
|
||||
err := enc.Encode(response)
|
||||
if err != nil {
|
||||
http.Error(rw, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
// We can't really do much about these errors, it's probably due to a
|
||||
// dropped connection.
|
||||
_ = enc.Encode(response)
|
||||
}
|
||||
|
||||
func WriteIndent(ctx context.Context, rw http.ResponseWriter, status int, response interface{}) {
|
||||
@ -169,11 +167,9 @@ func WriteIndent(ctx context.Context, rw http.ResponseWriter, status int, respon
|
||||
enc.SetEscapeHTML(true)
|
||||
enc.SetIndent("", "\t")
|
||||
|
||||
err := enc.Encode(response)
|
||||
if err != nil {
|
||||
http.Error(rw, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
// We can't really do much about these errors, it's probably due to a
|
||||
// dropped connection.
|
||||
_ = enc.Encode(response)
|
||||
}
|
||||
|
||||
// Read decodes JSON from the HTTP request into the value provided. It uses
|
||||
|
Reference in New Issue
Block a user