From a058ec51909babd3af2883807dcdc78c1a9e8767 Mon Sep 17 00:00:00 2001 From: Ian Littman Date: Thu, 16 Jan 2025 23:46:31 -0600 Subject: [PATCH 1/2] Exempt bootstrap package uploads from server-side request timeout For #25533 --- cmd/fleet/serve.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/fleet/serve.go b/cmd/fleet/serve.go index e1b74c135cca..d7cfe52ba682 100644 --- a/cmd/fleet/serve.go +++ b/cmd/fleet/serve.go @@ -1203,10 +1203,11 @@ the way that the Fleet server works. } if (req.Method == http.MethodPost && strings.HasSuffix(req.URL.Path, "/fleet/software/package")) || - (req.Method == http.MethodPatch && strings.HasSuffix(req.URL.Path, "/package") && strings.Contains(req.URL.Path, "/fleet/software/titles/")) { + (req.Method == http.MethodPatch && strings.HasSuffix(req.URL.Path, "/package") && strings.Contains(req.URL.Path, "/fleet/software/titles/")) || + (req.Method == http.MethodPost && strings.HasSuffix(req.URL.Path, "/bootstrap")) { var zeroTime time.Time rc := http.NewResponseController(rw) - // For large software installers, the server time needs time to read the full + // For large software installers and bootstrap packages, the server time needs time to read the full // request body so we use the zero value to remove the deadline and override the // default read timeout. // TODO: Is this really how we want to handle this? Or would an arbitrarily long From a2e3cd56740b6ed8178882f9292fa11756e6fec1 Mon Sep 17 00:00:00 2001 From: Ian Littman Date: Fri, 17 Jan 2025 08:19:23 -0600 Subject: [PATCH 2/2] Add changes file --- changes/25533-read-timeout-bootstrap-packages | 1 + 1 file changed, 1 insertion(+) create mode 100644 changes/25533-read-timeout-bootstrap-packages diff --git a/changes/25533-read-timeout-bootstrap-packages b/changes/25533-read-timeout-bootstrap-packages new file mode 100644 index 000000000000..2562d5ac94b6 --- /dev/null +++ b/changes/25533-read-timeout-bootstrap-packages @@ -0,0 +1 @@ +* Removed request timeout on bootstrap package uploads for consistency with software package upload endpoints