gravitee-io / issues

Gravitee.io - API Platform - Issues
64 stars 26 forks source link

[gateway-api] bad behavior on TransformationException if no policyChain #7130

Closed ytvnr closed 2 years ago

ytvnr commented 2 years ago

:collision: Describe the bug

We have weird behaviour resulting in timeout when a TransformationException occurs in a TransformableRequestStream or TransformableResponseStream and no policyChain is set.

With the fix, the API will end will a readable error instead of timeout.

:sunrise_over_mountains: To Reproduce

You can check with this API: https://apim-3-10-x-console.cloud.gravitee.io/#!/environments/DEFAULT/apis/69635ef0-422e-4259-a35e-f0422ef25959/design

Flows are already configured to have the error

JsonToJson Policy

Steps to reproduce the behaviour:

  1. Go to Design studio
  2. Add JsonToJson with a bad JOLT specification
  3. Try your api postman
  4. It ends in a timeout error (postman)

JsonToXml Policy

Steps to reproduce the behaviour:

  1. Go to Design studio
  2. Add JsonToXml twice in a row to reproduce the error
  3. Try your api postman
  4. It ends in a timeout error (postman)

JWS Policy

Not reproduced

XmlToJson Policy

Steps to reproduce the behaviour:

  1. Go to Design studio
  2. Add XmlToJson with a bad input generated by Assign content policy
  3. Try your api postman
  4. It ends in a timeout error (postman)

XSLT Policy

Steps to reproduce the behaviour:

  1. Go to Design studio
  2. Add Xslt policy with a bad timesheet
  3. Try your api postman
  4. It ends in a timeout error (postman)

:rainbow: Expected behaviour

The chain should fail properly. (no timeout)

:movie_camera: Useful information

LiliaEn commented 2 years ago

Tested on the 3.10.X env Browser: Chrome Version 98.0.4758.80 , macOS Big Sur v11.6 Works as expected.