diff --git a/paymentproxy/proxy.go b/paymentproxy/proxy.go index 00c4626590..68e306c74e 100644 --- a/paymentproxy/proxy.go +++ b/paymentproxy/proxy.go @@ -83,6 +83,7 @@ func NewPaymentProxy(proxyAddress string, nitroEndpoint string, destinationURL s // It is responsible for parsing the voucher from the query params and moving it to the request header // It then delegates to the reverse proxy to handle rewriting the request and sending it to the destination func (p *PaymentProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { + enableCors(w.Header()) // If the request is a health check, return a 200 OK if r.URL.Path == "/health" { w.WriteHeader(http.StatusOK) @@ -96,7 +97,7 @@ func (p *PaymentProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { if r.Method == "OPTIONS" { slog.Info("Handling preflight request") - enableCors(w.Header()) + w.WriteHeader(http.StatusOK) return