Skip to content

Commit 2e862f2

Browse files
Define constant for status 499 (#1501)
* Support websocket subprotocl. * use HTTPHeader() * Define constant for status code 499 Defined `statusClientClosedRequest` constant in `pkg/filters/proxies/httpproxy/pool.go` and replaced the hardcoded 499 usage with it. This addresses the TODO comment. Co-authored-by: LokiWager <32408858+LokiWager@users.noreply.github.com> --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent a2577c8 commit 2e862f2

File tree

1 file changed

+4
-2
lines changed
  • pkg/filters/proxies/httpproxy

1 file changed

+4
-2
lines changed

pkg/filters/proxies/httpproxy/pool.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ import (
4242
"github.com/prometheus/client_golang/prometheus"
4343
)
4444

45+
// statusClientClosedRequest is the status code for Client Closed Request.
46+
const statusClientClosedRequest = 499
47+
4548
var httpMethods = map[string]struct{}{
4649
http.MethodGet: {},
4750
http.MethodHead: {},
@@ -458,8 +461,7 @@ func (sp *ServerPool) doHandle(stdctx stdcontext.Context, spCtx *serverPoolConte
458461
}
459462

460463
// NOTE: return 499 if client is Disconnected.
461-
// TODO: define a constant for 499
462-
return serverPoolError{499, resultClientError}
464+
return serverPoolError{statusClientClosedRequest, resultClientError}
463465
}
464466

465467
spCtx.stdResp = resp

0 commit comments

Comments
 (0)