Skip to content

Commit

Permalink
skip out on options request
Browse files Browse the repository at this point in the history
  • Loading branch information
lalexgap committed Nov 2, 2023
1 parent ff84d60 commit f81d974
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions paymentproxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ func (p *PaymentProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
return
}

if r.Method == "OPTIONS" {
enableCors(w.Header())
w.WriteHeader(http.StatusOK)
return
}

v, err := parseVoucher(r.URL.Query())
if err != nil {
p.handleError(w, r, createPaymentError(fmt.Errorf("could not parse voucher: %w", err)))
Expand Down

0 comments on commit f81d974

Please sign in to comment.