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

API Rules not working when URL contains %20 #1539

Open
6 tasks
dfhoppe opened this issue Dec 12, 2024 · 0 comments
Open
6 tasks

API Rules not working when URL contains %20 #1539

dfhoppe opened this issue Dec 12, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@dfhoppe
Copy link

dfhoppe commented Dec 12, 2024

Description

We have seen that #1397 was implemented lately and we created our first API Rules v2alpha1.

However we are facing some issues when we have encoded spaces (%20) or “+” in the URL. To my understanding it should work also in these cases (correct me if I am wrong).

To detail more the issue we’re facing:

This is how our API Rule looks like:

apiVersion: gateway.kyma-project.io/v2alpha1
kind: APIRule
metadata:
  name: "{{ .Release.Name }}-approuter-apirulev2"
  namespace: "{{ .Release.Namespace }}"
spec:
  gateway: kyma-system/kyma-gateway
  hosts:
    - {{ printf "%s-approuter-%s.%s" .Release.Name .Release.Namespace .Values.global.domain }}
  rules:
    - methods:
        - GET
        - POST
        - PUT
        - PATCH
        - DELETE
        - HEAD
      noAuth: true
      path: /Stores/{**}
  service:
    name: {{ .Release.Name }}-approuter
    port: 8080

It works fine for this request:
GET /Stores/NoSpaceTest 200

But it always returns 404 for the requests below:
GET /Stores/Space%20Test 404

GET /Space+Test 404

Expected result
As all the requests are under /Stores I expected all of them to match the api rule, but as I said, the two last requests fail.

Actual result
Requests with %20 return 404

Steps to reproduce
Create API Rules v2alpha1 as above and send requests containing encoded whitespaces (%20) to a valid URL

Troubleshooting

DoD [Developer & Reviewer]

  • Provide unit and integration tests.
  • Provide documentation.
  • Verify if the solution works for both open-source Kyma and SAP BTP, Kyma runtime.
  • If you changed the resource limits, explain why it was needed.
  • Verify that your contributions don't decrease code coverage. If they do, explain why this is the case.
  • Add release notes.
@dfhoppe dfhoppe added the kind/bug Categorizes issue or PR as related to a bug. label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant