Skip to content

Gateway Routs URI without http:// prefic return code 200 with empty body #1764

@Bryksin

Description

@Bryksin

Hi

Our Cloud Gateway not correctly proxying requests.
On any request matching to the specific rout predicate, it was returning code 200 and no response body, even for invalid or non-existing endpoints

Config example:

gateway:
      routes:
        - id: notification
          uri: some-our-notification-service.com
          predicates:
            - Path=/notification/**
          filters:
            - RewritePath=/notification(?<path>.*), /$\{path}

so any request to:
https://our-api-gateway.com/notification/any-valid-or-no-existing-endpoint
return code was 200 and the response body was blank.

After we added http:// prefix to route URI:

gateway:
      routes:
        - id: notification
          uri: http://some-our-notification-service.com
          predicates:
            - Path=/notification/**
          filters:
            - RewritePath=/notification(?<path>.*), /$\{path}

it fixed the issue.

Even though URI requires schema definition and it was our fault to skip it, I would imagine it should throw an exception stating that configured URI is wrong, or even better resolve missing http:// prefix automatically.

But not returning a valid response with code 200 and empty body, as such response very much misleading and confusing, especially other services which using Gateway and thinks that request was successful because of response code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions