Skip to content

Commit

Permalink
Merge pull request #1836 from statechannels/fix-demo-cors
Browse files Browse the repository at this point in the history
Fix payment proxy handling of OPTIONS
  • Loading branch information
lalexgap authored Nov 2, 2023
2 parents ff84d60 + f81d974 commit 0f73668
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 0f73668

Please sign in to comment.