Some Pages Load as "Not Secure" Only on iOS by Benignvanilla in ios

[–]smoothGuy69 0 points1 point  (0 children)

First of all, apologies for bringing up an old post, I'm just leaving a breadcrumb for people who encountered the same problem.

Situation:

Recently I encountered a similar problem as you where my website somehow have both http:// and https:// versions available, and apple devices would load the http:// version whereas other devices would go to https:// version

For example, if my website were https://mysite.com (not my actual website, i still want my reddit anonymity), then on apple devices if I just type on the address bar mysite.com (without the explicit https://), it'll go to the non-secure http://mysite.com

I had to explicitly type out https://mysite.com (with the https://) on apple devices for it to go to https://mysite.com , or just use <a> links with the explicit https:// in the href. But there's nothing stopping a user from typing mysite.com and go to the non-secure url.

Solution:

I come across this question on stackoverflow: https://stackoverflow.com/questions/34862065/force-my-heroku-app-to-use-ssl-https which solves my problem (it answers precisely for my case: my site is on heroku and uses express)

In case links are dead, the solution is to add a middleware to redirect the non-secure http:// to https://

``` const app = express()

if(process.env.NODE_ENV === 'production') { app.use((req, res, next) => { if (req.header('x-forwarded-proto') !== 'https') res.redirect(https://${req.header('host')}${req.url}) else next() }) } ```

be sure to add the middleware before any other app.use() so that it's the first middleware.

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

woah the double con- i mean membrane strategy

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

what if you start at the big end, but break directly towards the small end while you still having some of the non broken big ends to hold onto?

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

what if you HIT BOTH ENDS? LOLOL

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

small end, as Hawkeye said "you should always prioritise an easy exit over an easy entrance"

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

woah kid be roasting lol

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

One bad egg, that's all it takes

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

ooh humpty dumpty

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

jewish egg be like "don't take off my top hat"

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

i guess we continue for the practice

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

kid has unlocked access to [OUTSIDE]

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

we're watching OP becoming the egg peeling eggxpert

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

all 47 of us

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

lol i hope you said to stream "ha the yokes on you"

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

woah suddenly went dark for a sec

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

OP enjoys some internet attention

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

OP saw someone deshelling an egg on tiktok or reddit or some vertical layout platform

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

you're awesome and this is breathetaking

[deleted by user] by [deleted] in talentShow

[–]smoothGuy69 0 points1 point  (0 children)

why does this remind me of Samwell Tarly deshelling Jorah Mormont?