Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests are not forwarded to the target if "address" URL includes a resource path #922

Open
karolpivo opened this issue Aug 2, 2024 · 0 comments

Comments

@karolpivo
Copy link

karolpivo commented Aug 2, 2024

When path_translation: CONSTANT_ADDRESS is used at the endpoint level and the address includes a resource path the ESP does not forward the request to the target backend address.

With the below configuration the requests are forwarded (the target backend returns 404 because there is nothing at root path):

 /ourendpoint/healthz:
    get:
      summary: health check
      operationId: ourEndpointhHealthz
      x-google-backend:
        address: https://ourendpoint-2jxxxxdi7a-lm.a.run.app
        path_translation: CONSTANT_ADDRESS
        protocol: h2
      security: []
      responses:
        "200":
          description: success

Screenshot below shows the GCP logs. The behavior is as expected

image

With the below configuration the Cloud Endpoint / ESP simply returns a 404 and does not attempt to forward to the target

 /ourendpoint/healthz:
    get:
      summary: health check
      operationId: ourEndpointhHealthz
      x-google-backend:
        address: https://ourendpoint-2jxxxxdi7a-lm.a.run.app/healthz
        path_translation: CONSTANT_ADDRESS
        protocol: h2
      security: []
      responses:
        "200":
          description: success

Screenshot below shows the GCP logs.

image

Expected behavior:

ESP forwards the request to address: https://ourendpoint-2jxxxxdi7a-lm.a.run.app/healthz when
path_translation: CONSTANT_ADDRESS is set

This is how it should work according to documentation https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#understanding_path_translation

Actual behavior

ESP returns a 404 and does not attempt to forward the request to the target backend when target address included a resource

Tested with 2.47.0 and 2.50.0

Please advise if this is a bug or me doing something wrong

@karolpivo karolpivo changed the title Request are not forwarded to the target if "address" URL includes a resource path Requests are not forwarded to the target if "address" URL includes a resource path Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant