Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Per anchor control of flipping between http and https for a session rather than whole application #97

Open
GoogleCodeExporter opened this issue Mar 25, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

How to run a single site that flips back and forth between secure and non 
secure pages 
dynamically on a anchor to anchor basis and generating the unspecified anchors 
correctly (I 
hacked up my own versions of secureCallback: and unsecuredCallback: to do this 
on 
ReserveTravel) because setting the server port and server protocol globally on 
the application 
itself seems wrong, but maybe I'm missing something.

Here's what I currently do...

WAAnchorTag>>secureCallback: actionBlock
    url := (canvas secureCallback: actionBlock) displayString

WAAnchorTag>>unsecuredCallback: actionBlock
    url := (canvas unsecuredCallback: actionBlock) displayString

WARenderCanvas>>secureCallback: actionBlock 
    ^ (context actionUrl withParameter: (self callbacks registerActionCallback: actionBlock))
        scheme: #https;
        port: 443;
        yourself

WARenderCanvas>>unsecuredCallback: actionBlock 
    ^ (context actionUrl withParameter: (self callbacks registerActionCallback: actionBlock))
        scheme: #http;
        port: 80;
        yourself

That's enough to generate the anchors that force a switch to http or https and 
seems generic 
enough, but for allowing unspecified regular #callback: to work correctly for 
both modes I use 
something I think I got from Avi a few years ago that looks for an http header 
from Apache in my 
session class..

SSSession>>actionUrlForContinuation: aContinuation 
    | url |
    url := super actionUrlForContinuation: aContinuation.
    self useSSL ifTrue: 
        [ url
            scheme: #https;
            port: 443 ].
    ^ url

SSSession>>actionUrlForKey: aString 
    | url |
    url := super actionUrlForKey: aString.
    self useSSL ifTrue: 
        [ url
            scheme: #https;
            port: 443 ].
    ^ url

SSSession>>useSSL
    ^ currentRequest headers includesKey: 'arnhttps'        


Original issue reported on code.google.com by ramon.l...@gmail.com on 13 Jul 2008 at 4:04

@GoogleCodeExporter
Copy link
Author

Original comment by jfitz...@gmail.com on 29 Aug 2008 at 1:06

  • Added labels: Type-Feature
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

Original comment by jfitz...@gmail.com on 29 Aug 2008 at 1:06

  • Added labels: Priority-Low
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

see also Sean's answer, you should provide a hostname

http://forum.world.st/from-http-to-https-tc997547.html#a997580

Original comment by davide.v...@gmail.com on 23 Sep 2012 at 1:26

  • Added labels: ****
  • Removed labels: ****

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant