Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@jschoe

Description

@jschoe
Issue body actions
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.