Skip to content

X-Forwarded-Proto isn't respected in MVC Request due to wrong server variable being set #118

@DorianGreen

Description

@DorianGreen

Describe the bug

ProxyHeaderModule is currently setting the SERVER_PROTOCOL variable based on x-forwarded-proto.
This variable is should be used to denote the HTTP protocol (i.e. HTTP/1.1 or HTTP2) and not the scheme (HTTP vs HTTPS).
IIS/ASP.NET use the HTTPS boolean server variable for the scheme.

To Reproduce

  1. send a request to any controller action with http scheme, adding a X-Forwarded-Proto=https header
  2. in the action check context..Request.RequestUri.Scheme
  3. value should be https but returns http

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions