Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Golang, Heroku - How to check if request is https

Tags:

heroku

go

Documentation suggests you can check TLS on the request object, but that appears to be nil (on heroku at least).

like image 607
Jordan Avatar asked Dec 17 '25 18:12

Jordan


1 Answers

Looking at the Heroku documentation, it appears that HTTPS is terminated upstream of your application.

Check the request's Headers for a X-Forwarded-Proto header with the value https.

like image 64
lnmx Avatar answered Dec 19 '25 18:12

lnmx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!