Joshua White opened SPR-16676 and commented

I have a use case where I only want to have a controller handle a request if the request is over a secure channel. For this use case, secure and insecure requests are both valid and need to be handled differently.

Adding "secure" attribute, possible with an Enum indicating true/false to the RequestMapping would allow me to do this in a declarative way rather than having to check the servletRequest (ex. servletRequest.isSecure()) for this attribute directly.

If this seems reasonable, I'd like to discuss the approach and submit a pull request.


Affects: 5.0.4

Comment From: spring-projects-issues

Rossen Stoyanchev commented

It's not unreasonable for sure, but worth asking if you see this in a lot of places? Also it'd be useful to consider a concrete use case, i.e. what controller method arguments and what the controller does in each case, etc.

Comment From: rstoyanchev

Closing for now as there hasn't been much interest.