eliom
eliom copied to clipboard
Redirection service fail with post parameters
I have a POST service (A) that takes POST parameters. I register this service as a Redirection, and I redirect towards a get service (B) that takes no parameters, after having done some server update (A is a service for someone to create a login for the site, so when he clicks OK on the registration page I register him and then redirect him toward the welcome page). I get this exception in my browser: Ocsigen_extensions.Ocsigen_http_error(_) but nothing in the server logs. The url in the browser is changed to the URL of B. When I try to reload the page, I get a "confirm form resubmission" message, like there are still POST parameters in the request, and if I hit OK it fails with the same Ocsigen_http_error message. If I just hit enter on the url it loads service B correctly.
I changed A to be a service that takes only GET parameters, and transferred all my previous POST parameters to GET parameters, and it worked, B is not correctly my landing page.
It looks like the POST parameters passed to service A are transferred to service B during the redirection, and B doesn't like that.
Please provide a small failing example. I tried to faithfully reproduce what you describe (code) and it seems to work.
Your example looks very much like what I'm doing, except for 2 differences:
- I'm using Eliom 5, I'm not sure if that makes a difference
- I don't have the
Eliom_client.change_page ~%redir_service () 0.Did you do that just to make your example shorter or if you do this every time you write a form? I might make a difference.
I'll try to extract a smallest failing example from my code.
I don't have the Eliom_client.change_page ~%redir_service () 0.Did you do that just to make your example shorter or if you do this every time you write a form? I might make a difference.
I did that to see what happens if you call this service directly, without a form. I could have omitted it. There is a separate form right below.