8000 [Routing] Redirecting POST requests to the correct scheme seems to be broken · Issue #26402 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Routing] Redirecting POST requests to the correct scheme seems to be broken #26402

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

Closed
jschoe opened this issue Mar 5, 2018 · 1 comment
Closed
Labels

Comments

@jschoe
Copy link
jschoe commented Mar 5, 2018
Q A
Bug report? yes
Feature request? no
BC Break report? maybe
RFC? no
Symfony version 2.8.35

Redirecting to the correct scheme seems to be broken for POST requests. Possibly related to either
#26312 or #26100

This routing.yml example

test1:
  path: /foo
  defaults: { _controller: AppBundle:Api:foo }
  schemes: https

test2:
  path: /foo2
  defaults: { _controller: AppBundle:Api:foo }
  methods: GET
  schemes: https

test3:
  path: /foo3
  defaults: { _controller: AppBundle:Api:foo }
  methods: POST
  schemes: https

leads to:

$ http GET http://myhost/foo --headers
HTTP/1.1 301 Moved Permanently

$ http GET http://myhost/foo2 --headers
HTTP/1.1 301 Moved Permanently

$ http POST http://myhost/foo3 --headers
HTTP/1.1 404 Not Found

I'm aware of the potential issues with redirecting POST requests, but up to symfony 2.8.34 all three examples where redirected to the expected scheme. In fact this was caught by a controller test expecting a 301.

I'm using HTTPie for the examples here, but using curl leads to the same results.

@jschoe jschoe changed the title [Routing] Redirecting POST Requests to the correct scheme seems to be broken [Routing] Redirecting POST requests to the correct scheme seems to be broken Mar 5, 2018
@Tobion
Copy link
Contributor
Tobion commented Mar 5, 2018

Redirecting POST request with 301 will change the request method. So this was broken.

@xabbuh xabbuh added the Routing label Mar 5, 2018
@xabbuh xabbuh closed this as completed Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
0