feat(api): add card-to-iban HTTP endpoint

This commit is contained in:
2026-09-21 11:46:35 +03:30
parent b713a4daf1
commit 5dbfe0a12f
4 changed files with 703 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
package httpapi
import "net/http"
func AllowOrigin(
origin string,
next http.Handler,
) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Add("Vary", "Origin")
if r.Header.Get("Origin") == origin {
w.Header().Set("Access-Control-Allow-Origin", origin)
w.Header().Set("Access-Control-Allow-Headers", "Content-Type")
w.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS")
if r.Method == http.MethodOptions {
w.WriteHeader(http.StatusNoContent)
return
}
}
next.ServeHTTP(w, r)
})
}