Ssl_requirement, posts change to get and parameters are lost

Hi,

I hope this isn’t a stupid question but I’ve searched all over and can’t
find any one else having the same issue.

I have just tried to add ssl to my app using ssl_requirement. I have
hit a snag when my product page attempts to submit to my add to cart
action.

From the logs as far as I can tell what is happening is that the initial
submit of the form has the correct parameters, then it gets caught by
ssl_requirement and redirected to https but at this point it appears to
have changed from a post request to a get request and my parameters with
product id and quantity are no longer in the request.

Is this something that is known or am I just doing something wrong:
I’ll append a snippit from the log so you can see the issue.

Thanks for any help

Bart

Processing StoreController#view_product (for 1.2.3.4 at 2008-02-04
22:08:55) [GET]
Session ID: cf83cbfcc7f51c2023aab3d2dc5de576
Parameters: {“action”=>“view_product”, “id”=>“7”,
“controller”=>“store”}
Rendering within layouts/store
Rendering store/view_product
Completed in 0.11419 (8 reqs/sec) | Rendering: 0.04087 (35%) | DB:
0.00911 (7%) | 200 OK [http://new.website.com/store/view_product/7]

Processing StoreController#shopping_cart (for 1.2.3.4 at 2008-02-04
22:08:58) [POST]
Session ID: cf83cbfcc7f51c2023aab3d2dc5de576
Parameters: {“commit”=>“Add to Cart”, “quantity”=>“1”,
“action”=>“shopping_cart”, “id”=>“7”, “controller”=>“store”}
Redirected to https://new.website.com/store/shopping_cart
Filter chain halted as
[#<ActionController::Filters::ClassMethods::SymbolFilter:0xb7075708
@filter=:ensure_proper_protocol>] returned_false.
Completed in 0.00041 (2416 reqs/sec) | DB: 0.00000 (0%) | 302 Found
[http://new.website.com/store/shopping_cart]

Processing StoreController#shopping_cart (for 1.2.3.4 at 2008-02-04
22:08:58) [GET]
Session ID: cf83cbfcc7f51c2023aab3d2dc5de576
Parameters: {“action”=>“shopping_cart”, “controller”=>“store”}
log we think the cart is empty 0 redirecting to prev page
Redirected to http://new.website.com/store/view_product/7
Completed in 0.13120 (7 reqs/sec) | DB: 0.00750 (5%) | 302 Found
[https://new.website.com/store/shopping_cart]

Processing StoreController#view_product (for 1.2.3.4 at 2008-02-04
22:08:59) [GET]
Session ID: cf83cbfcc7f51c2023aab3d2dc5de576
Parameters: {“action”=>“view_product”, “id”=>“7”,
“controller”=>“store”}
Rendering within layouts/store
Rendering store/view_product
Completed in 0.09578 (10 reqs/sec) | Rendering: 0.03834 (40%) | DB:
0.00856 (8%) | 200 OK [http://new.website.com/store/view_product/7]

Bart,

Just reading your log comments and the third includes this, “log we
think the cart is empty 0 redirecting to prev page.” Is that a
symptom or cause of the problem?

On Feb 4, 6:44 am, Bart B. [email protected]

AndyV wrote:

Bart,

Just reading your log comments and the third includes this, “log we
think the cart is empty 0 redirecting to prev page.” Is that a
symptom or cause of the problem?

On Feb 4, 6:44 am, Bart B. [email protected]

This is a simptom. What happens is that at the top of the function I
check if we are passed the id of a product to add or if the cart is
empty.

As the parameter id to add the product to the cart isn’t passed through
the https redirect for some reason and this is the first item we are
adding to the cart it redirects back to where you came from.

I could change it to show an empty cart I guess but that still wouldn’t
solve the problem of losing the parameters.
Bart

We are running into a similar issue on a project…have been trying to
work around it for the past couple days.

We see:
Filter chain halted as
[#<ActionController::Filters::ClassMethods::SymbolFilter:0xb7575474
@filter=:ensure_proper_protocol>] rendered_or_redirected.

But then the page does not render!

Anyone have any suggestions as to how to resolve this?

We are using the following plugins:
acts_as_state_machine
acts_as_tree
calendar_date_select
restful_authentication
ssl_requirement

We’re on RHE4 linux using:
Apache 2.2.6
Rails 2.02
Ruby 1.8.6

kozmic wrote:

On Apr 25, 6:27�pm, David C. [email protected]
wrote:

We see:
Filter chain halted as
[#<ActionController::Filters::ClassMethods::SymbolFilter:0xb7575474
@filter=:ensure_proper_protocol>] rendered_or_redirected.

We have the same log entries.

Our workaround was to add ssl_required to all controllers and their
actions, missing one will give you this error (atleast for us).

Hrm, even this doesn’t seem to work for me… Anyone else have thoughts?
This did work before when I tested out ssl_requirement earlier in my
app’s development. Has something changed?

class ApplicationController < ActionController::Base

include AuthenticatedSystem
include SslRequirement

before_filter :require_ssl

helper :all

def require_ssl
redirect_to :protocol => “https://”
end

def ssl_required?
true
end

end

Filter chain halted as [:ensure_proper_protocol] rendered_or_redirected.

On Apr 25, 6:27 pm, David C. [email protected]
wrote:

We see:
Filter chain halted as
[#<ActionController::Filters::ClassMethods::SymbolFilter:0xb7575474
@filter=:ensure_proper_protocol>] rendered_or_redirected.

We have the same log entries.

Our workaround was to add ssl_required to all controllers and their
actions, missing one will give you this error (atleast for us).