getheimdall / heimdall

An easy way to orchestrate your Api's
Apache License 2.0
24 stars 14 forks source link

Resource load order generates unexpected behavior on the gateway #371

Open geovanaSouza opened 4 years ago

geovanaSouza commented 4 years ago

Describe the bug We had unexpected and intermittent behavior when registering two different operations for the same path.

We registered a GET operation for all API paths: GET / And we register a second operation as POST for the same path: POST /

Some times we check that the gateway returned the message: Request method 'POST' not supported

However, at other times the POST request was successfully processed.

We think this behavior may be related to the order that this setting is loaded on the gateway at the time of restart or reload of the settings.

We also noticed that even though heimdall returning 500 to the requesting client, the request was passed to the microservice behind the Gateway. We expected that the request should be stopped at the gateway with the error, not passed to the later layer. Is this the expected behavior?

To Reproduce Steps to reproduce the behavior:

  1. Go to Resources
  2. Register an operation as GET to path /**
  3. Register an operation as POST to path /**
  4. Test the APIs and reload your gateway to simulate the intermitent behavior

Expected behavior Allow both GET and POST for paths registered

Screenshots Screenshot from 2019-12-04 13-48-38

MAAARKIN commented 4 years ago

Hi @geovanaSouza sry to anwser this issue too late, but this behavior occours because exist an order path, and first we find an operation by path and after that we check the verb and when you set POST and GET to /** the gateway get the two operations to a List interface and sometimes the first is GET and sometimes is POST, i will reproduce here to fix that. thx so much.