membrane / api-gateway

API gateway for REST, OpenAPI, GraphQL and SOAP written in Java.
https://membrane-api.io
Apache License 2.0
457 stars 137 forks source link

`<groovy/>` sets empty Response in the Response flow, when `exc.getResponse() == null` #761

Open rrayst opened 11 months ago

rrayst commented 11 months ago

This leads to

            <groovy>
                println exc.getRequest().getUri()
            </groovy>

producing weird 200 OK responses in error cases.

(This is due to: https://github.com/membrane/api-gateway/blob/3e20594eef6c96bf3bb6174510b6ec971ff32be7/core/src/main/java/com/predic8/membrane/core/interceptor/AbstractInterceptor.java#L136 )

predic8 commented 11 months ago

@t-burch Test and post how the wired response looks like (test with curl).

I do not know if we should change something. Cause this might not the only Interceptor. Maybe we should check in the Transport if response==null and then provide an error message?

t-burch commented 3 months ago

In what circumstance does it set the 200 OK response, how can one reproduce that