mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Bug-15430 change timeout errror code to 408 (#15552)
This commit is contained in:
parent
9236a19342
commit
da755ea2ea
2 changed files with 6 additions and 1 deletions
1
changes/15430-change-script-timeout-error-code-to-408
Normal file
1
changes/15430-change-script-timeout-error-code-to-408
Normal file
|
|
@ -0,0 +1 @@
|
|||
- POST /api/v1/fleet/scripts/run/sync timeout (longer than 60 seconds) will now return error code: 408 instead of 504
|
||||
|
|
@ -64,7 +64,11 @@ type runScriptSyncResponse struct {
|
|||
func (r runScriptSyncResponse) error() error { return r.Err }
|
||||
func (r runScriptSyncResponse) Status() int {
|
||||
if r.HostTimeout {
|
||||
return http.StatusGatewayTimeout
|
||||
// The more proper response for a timeout on the server would be: StatusGatewayTimeout = 504
|
||||
// However, as described in https://github.com/fleetdm/fleet/issues/15430 we will send:
|
||||
// StatusRequestTimeout = 408 // RFC 9110, 15.5.9
|
||||
// See: https://github.com/fleetdm/fleet/issues/15430#issuecomment-1847345617
|
||||
return http.StatusRequestTimeout
|
||||
}
|
||||
return http.StatusOK
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue