update handler
Some checks failed
Build and Publish / Metadata (push) Successful in 9s
Build and Publish / BuildAndDeployAmd64 (push) Failing after 42s
Build and Publish / BuildAndDeployArm64 (push) Has been cancelled

This commit is contained in:
matst80
2025-11-05 18:26:26 +01:00
parent c71b668a87
commit 42913a079f

View File

@@ -455,6 +455,7 @@ func (s *PoolServer) ProxyHandler(fn func(w http.ResponseWriter, r *http.Request
if ownerHost, ok := s.OwnerHost(uint64(cartId)); ok {
_, span := tracer.Start(r.Context(), "proxy")
defer span.End()
span.SetAttributes(attribute.String("other host", ownerHost.Name()))
handled, err := ownerHost.Proxy(uint64(cartId), w, r)
@@ -563,9 +564,8 @@ func (s *PoolServer) RemoveVoucherHandler(w http.ResponseWriter, r *http.Request
return nil
}
func (s *PoolServer) Serve() *http.ServeMux {
func (s *PoolServer) Serve(mux *http.ServeMux) {
mux := http.NewServeMux()
mux.HandleFunc("OPTIONS /", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, PUT, POST, DELETE")