IsSecureConnection() is Not working in Timer Action

IsSecureConnection() is Not working in Timer Action

  

I tried to get the Application is deployed in Prod Or Dev Env. I mean it is HTTP or HTTPS. For this I have used  IsSecureConnection() method inside Timer Action.

But I didn't get proper value. 

Can any one help on this?

Hello Subramanyam,

A timer will always be executed by the Scheduler Service, even if you awake it through a Wake action.

So, there is really no point in detecting if the connection is secure or not, as it is not comming from the "client" or the outside world...

IMHO you shouldn't have code, in production, meant to execute only in dev.
This is an architecture failure.

Exactly what are you trying to avoid to run in Production, taht you can't separate in a different module (and even application), and don't pass it to Production?

Why do you need to identify if it is a Production or Dev environment?

Cheers.

Eduardo Jauch wrote:

Hello Subramanyam,

A timer will always be executed by the Scheduler Service, even if you awake it through a Wake action.

So, there is really no point in detecting if the connection is secure or not, as it is not comming from the "client" or the outside world...

IMHO you shouldn't have code, in production, meant to execute only in dev.
This is an architecture failure.

Exactly what are you trying to avoid to run in Production, taht you can't separate in a different module (and even application), and don't pass it to Production?

Why do you need to identify if it is a Production or Dev environment?

Cheers.


Hi Eduardo Jauch,

Thanks for your reply. Here my intention is , If the Application in secured then i have to send application URL with "https://Some URL" or "http://Some URL" by Email.

I Scheduled a Timer to trigger the Email, So i have to send this data.


Solution

Hum...

Take a look here: https://success.outsystems.com/Documentation/10/Managing_the_Applications_Lifecycle/Secure_the_Applications/Enforce_HTTPS_Security

You can set the environment Production to force https (or application), so even if the request is http, it will be redirected to https. This way you don't have to wrroy about this in your code.

Cheers.

Solution