diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 001c7839..8079bcbe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,7 @@ jobs: ./ory proxy https://ory-network-httpbin-ijakee5waq-ez.a.run.app --quiet --rewrite-host & npm run test env: + ORY_API_KEY: placeholder ORY_PROJECT_SLUG: affectionate-archimedes-s9mkjq77k0 ORY_CONSOLE_URL: https://console.staging.ory.dev ORY_ORYAPIS_URL: https://staging.oryapis.dev diff --git a/cmd/cloudx/proxy/helpers.go b/cmd/cloudx/proxy/helpers.go index 2f7761d2..a308d286 100644 --- a/cmd/cloudx/proxy/helpers.go +++ b/cmd/cloudx/proxy/helpers.go @@ -134,9 +134,14 @@ func runReverseProxy(ctx context.Context, h *client.CommandHelper, stdErr io.Wri mw.UseFunc(sessionToJWTMiddleware(conf, writer, key, signer, oryURL)) // This must be the last method before the handler } - upstream, err := url.ParseRequestURI(conf.upstream) - if err != nil { - return errors.Wrap(err, "unable to parse upstream URL") + var upstream *url.URL + if conf.upstream != "" { + upstream, err = url.ParseRequestURI(conf.upstream) + if err != nil { + return errors.Wrap(err, "unable to parse upstream URL") + } + } else { + upstream = oryURL } mw.UseHandler(proxy.New(