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

Fix Rewrite-target regex #3699

Merged
merged 2 commits into from
Jul 31, 2018
Merged

Fix Rewrite-target regex #3699

merged 2 commits into from
Jul 31, 2018

Conversation

dtomcej
Copy link
Contributor

@dtomcej dtomcej commented Jul 30, 2018

What does this PR do?

Removes an added slash in the Redirect-target annotation regex

Motivation

Fixes #3698, slash was accidentally added in #3582

More

  • Added/updated tests
  • Added/updated documentation - None needed, bugfix

Additional Notes

The ingress:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: whoami
  annotations:
     traefik.ingress.kubernetes.io/rewrite-target: /demo
spec:
  rules:
  - host: localhost
    http:
      paths:
      - path: /testing
        backend:
          serviceName: whoami
          servicePort: http

Now properly creates the following path rewrites:

$ curl -v localhost:31117/testing -silent 2>&1 | grep GET

> GET /testing HTTP/1.1
GET /demo HTTP/1.1

$ curl -v localhost:31117/testing/ -silent 2>&1 | grep GET

> GET /testing/ HTTP/1.1
GET /demo/ HTTP/1.1

$ curl -v localhost:31117/testing/bacon -silent 2>&1 | grep GET

> GET /testing/bacon HTTP/1.1
GET /demo/bacon HTTP/1.1

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants