I apologize for not attaching the patch diff - this is my first time and I've not been able to figure out how to attach it. Please consider including a sentence on the Contribute page for new contributors.
This change addresses two issues. First, Nate Jones of Media Temple openly contributed the port check, which enables the plugin to work on Apache 2.0 and above versus just Apache 2.2+. My contribution allows developers using the WEBrick server to use this plugin and be able to continue to see their work locally.
Without my code, actions associated with the plugin will fail since the request will forward to https:// on localhost. Most developers won't have installed an ssl cert to remedy this issue. Given the endorsement of the plugin in the second edition book, it's highly likely that other developers (especially newbies such as myself) will utilize this resource and potentially be frustrated when they can't see their work locally - this resolves that issue with the only assumption that they haven't modified the default port number.
The change is a single line, so I'm going to copy and paste it below.
File: vendor/plugins/ssl_requirement/lib/ssl_requirement.rb
17 - if ssl_required? && !request.ssl?
18 + if ssl_required? && !(request.ssl?
request.port == 443) && request.port_string != ":3000"
Thanks for your consideration.
Attachments
Change History
Download in other formats:
|