The "client.scheme" Value is Always "http"

I have a JavaScript policy, in the default endpoint preflow, with the following statement:

print('CLIENT SCHEME: ' + context.getVariable("client.scheme"));

If I make a call using https, it will print "CLIENT SCHEME: http". I have tested with curl calls and calls made from a web page running in https.

0 6 275
6 REPLIES 6

@williamking , Are you on cloud / OPDK ? OnCloud, I am unable to reproduce above issue. See attached screenshot. It works as per design. Am i missing something ?

3297-screen-shot-2016-08-05-at-112554-pm.png

It is running in the cloud. Please find attached a proxy I just made to demo the behavior I'm seeing. It might be something specific to our instance running in EDGE.

(Note that it is a gzip file. I've changed the extension to "txt" to be able to upload.)

test-scheme-proxygzip.txt

@williamking , I just used your proxy in one of my trial org , It works as per design. Looks like it's specific to your org / your org might be running on the different version. Please talk to support to resolve the issue.

Here is the screenshot from your proxy trace session,

3303-screen-shot-2016-08-05-at-112554-pm.png

Not applicable
@Anil Sagar

,

Have you tried context variable (request.header.X-Forwarded-Proto). This should give you the value of http vs https.

@MEGHDEEP BASU , client.scheme also works as expected, I think it's an org specific issue which need to be resolved by support.

Yes. You are right. The "client.scheme" also works for me.