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

request.url does not reflect the current url scheme with a tls server #703

Closed
malud opened this issue Feb 3, 2023 · 0 comments · Fixed by #704
Closed

request.url does not reflect the current url scheme with a tls server #703

malud opened this issue Feb 3, 2023 · 0 comments · Fixed by #704
Assignees
Labels
bug Something isn't working
Milestone

Comments

@malud
Copy link
Collaborator

malud commented Feb 3, 2023

Describe the bug
Since #615 Couper may being used with the tls option which leads to the following behaviour.

To Reproduce
Steps to reproduce the behavior:

  1. Which Couper version? Run couper version or docker run avenga/couper version
    edge
  2. Provide your configuration file *.hcl. Remove sensitive data.
server {
  hosts = ["*:4443"]

  tls {} #self-signed

  endpoint "/" {
    response {
      headers = {
        location = request.url
      }
    }
  }
}
  1. Provide a curl call for reproduction
curl -vk https://localhost:4443

> GET / HTTP/2
> Host: localhost:4443
> user-agent: curl/7.85.0
> accept: */*
> 

< HTTP/2 200 
< couper-request-id: cfej8etnsevi8b03uop0
< location: http://localhost:4443/
  1. See an error response or error log.

location: http://localhost:4443/ must be location: https://localhost:4443/

Additional context
This also leads to wrong redirects for example while using the oidc configuration in combination with TLS:

headers {
  location = "${oauth2_authorization_url("oidc")}&state=${url_encode(relative_url(request.url))}"
}

This url would be unknown to a configured application.

@malud malud added the bug Something isn't working label Feb 3, 2023
@malud malud added this to the 1.12.1 milestone Feb 3, 2023
@malud malud self-assigned this Feb 3, 2023
malud added a commit that referenced this issue Feb 3, 2023
malud added a commit that referenced this issue Feb 3, 2023
johakoch added a commit that referenced this issue Feb 6, 2023
* #703 also take tls reqs into account

* add changelog

* Update CHANGELOG.md

Co-authored-by: Johannes Koch <53434855+johakoch@users.noreply.github.com>

---------

Co-authored-by: Johannes Koch <53434855+johakoch@users.noreply.github.com>
@malud malud closed this as completed Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant