Compare commits

..

1 Commits

Author SHA1 Message Date
4044386897 docs: update rollout docs 2025-10-22 19:57:39 +02:00
2 changed files with 3 additions and 2 deletions

View File

@@ -78,7 +78,8 @@ func (hs *HTTPServer) corsMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS") w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization") w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept")
w.Header().Set("Access-Control-Expose-Headers", "Content-Type, Content-Length")
if r.Method == "OPTIONS" { if r.Method == "OPTIONS" {
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)

View File

@@ -132,7 +132,7 @@ func (c *RegistryClient) UploadFirmware(metadata FirmwareMetadata, firmwareFile
} }
defer resp.Body.Close() defer resp.Body.Close()
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {
body, _ := io.ReadAll(resp.Body) body, _ := io.ReadAll(resp.Body)
return nil, fmt.Errorf("firmware upload failed with status %d: %s", resp.StatusCode, string(body)) return nil, fmt.Errorf("firmware upload failed with status %d: %s", resp.StatusCode, string(body))
} }