Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Added Permanent property to configure redirect in RequireHttpsAttribute #4602

Merged

Conversation

khellang
Copy link
Contributor

@khellang khellang commented May 9, 2016

As promised in #4579

Fixes #4561

@khellang khellang force-pushed the require-https-configurable-redirect branch 3 times, most recently from e2e0f12 to 8d6a565 Compare May 12, 2016 11:16
@Eilon
Copy link
Member

Eilon commented May 16, 2016

@khellang thanks for the PR! I've assigned this to an engineer on the team and we'll get it reviewed and merged ASAP.

@sebastienros
Copy link
Member

LGTM, I am still trying to run it locally, facing some unrelated issues right now.

@sebastienros sebastienros merged commit 230776f into aspnet:dev May 16, 2016
@khellang khellang deleted the require-https-configurable-redirect branch May 17, 2016 16:07
@ShadowDancer
Copy link

That's great, but how can I set Permanent property after adding filter globally?
Something like this:
services.AddMvc( opt => { opt.Filters.Add(typeof (RequireHttpsAttribute)); });

Currently I have to create my own wrapper filter. Maybe such filter should be in framework(RequireHttpsPermanentAttribute) or configurable with IOptions?

@pranavkm
Copy link
Contributor

pranavkm commented Jun 2, 2016

@ShadowDancer, you should be able to add an instance of the attribute to the filter collection:
opt.Filters.Add(new RequireHttpsAttribute { Permanent = true })

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

Successfully merging this pull request may close these issues.

6 participants