@request.restful()
def shove():
if not request.is_https:
redirect(URL(shove, args=request.args, scheme=https, host=True))
def POST(*args, **vars):
etc
You tried use the request.requires_https() in your models?
And to respect of redirect .. Could you use the absolute URL .. Create completly
The doc of URL() have this..
On Tuesday, May 30, 2017 at 2:59:58 PM UTC-7, Marlysson Silva wrote:The request.requires_https() is written on top of models file once time..And to respect of redirect .. Could you use the absolute URL .. Create completly
The doc of URL() have this..
I went back to the model file with mixed results. The first try, I had a typo that meant things were broken but I wasn't seeing the tickets right away.
The mixed results:
A linux client, using libcurl, is reporting what seems to be a correct redirect now. I still need to tell libcurl what to do with that. (Per libcurl recommendations, I'll use the rx'd URL as the new destination and retry the send; the option to automatically follow isn't recommended.)
A winnders client, using wininet, just keeps sending to port 80. I'm trying to get tcpdump to tell me if the redirect is sent; my first attempts don't see it.
Changing the clients to start on port 443 works, but I want to have the redirs work, too.
On Tuesday, May 30, 2017 at 11:15:46 PM UTC-7, Dave S wrote:
On Tuesday, May 30, 2017 at 2:59:58 PM UTC-7, Marlysson Silva wrote:The request.requires_https() is written on top of models file once time..And to respect of redirect .. Could you use the absolute URL .. Create completly
The doc of URL() have this..
I went back to the model file with mixed results. The first try, I had a typo that meant things were broken but I wasn't seeing the tickets right away.
The mixed results:
A linux client, using libcurl, is reporting what seems to be a correct redirect now. I still need to tell libcurl what to do with that. (Per libcurl recommendations, I'll use the rx'd URL as the new destination and retry the send; the option to automatically follow isn't recommended.)
Redir works for a browser (to an actual webpage, not a
A winnders client, using wininet, just keeps sending to port 80.
I'm trying to get tcpdump to tell me if the redirect is sent; my first attempts don't see it.
This is because the POST has to be completely sent before this technique works, and my wininet clients don't seem to cleanly end the send. Some minutes after the client tells the user that it is done, Rocket throws up its hands and says "broken pipe". (I've a group post about that, probably sometime last year).
For browsers and libcurl clients, the POST completes, the redir is sent, the client uses the new URL, and and everyone lives happily ever after.
Is there a way to tell Rocket to send the redir as soon as the URL is received? This is typically in the first packet after the connection opening handshakes; does Rocket ever look at URLs, or is the routing extracted at a higher level? (My first read of rocket.py didn't clue me in very far.)Changing the clients to start on port 443 works, but I want to have the redirs work, too.
Again, varies by client. wininet is picking up that the scheme is HTTPS, but it doesn't seem to change ports to reflect that.
A winnders client, using wininet, just keeps sending to port 80.I'm trying to get tcpdump to tell me if the redirect is sent; my first attempts don't see it.
This is because the POST has to be completely sent before this technique works, and my wininet clients don't seem to cleanly end the send. Some minutes after the client tells the user that it is done, Rocket throws up its hands and says "broken pipe". (I've a group post about that, probably sometime last year).
Looks like that's about 10 minutes. The POST DATA sits in a tmp file during that time; if my app accepts the data it gets moved into the uploads directory, if I don't (as when I'm trying to do a redir) it gets rm'd.