Skip to content

Conversation

linki
Copy link

@linki linki commented Feb 25, 2017

I run Drone behind Armor with AutoTLS enabled.

However, when enabling the Github integration in Drone it generates http:// URLs for the OAuth2 redirect URL and also for the Github Webhook URLs since it's configured to serve plain HTTP and is unaware of the proxy.

Setting the X-Forwarded-Proto header on the request to upstream if the original request was TLS fixes the problem for Drone and probably many others.

I tested the happy paths with Drone but:

  • I don't know how it behaves with Upgrade requests.
  • Also, if the incoming request already includes the header (e.g. from an ELB) it will be overwritten by Armor.
  • Furthermore, if the upstream target is https then the header will be set as well although it wouldn't be required.

I don't think any of this leads to problems but I would love your feedback on them.

@coveralls
Copy link

coveralls commented Feb 25, 2017

Coverage Status

Coverage decreased (-0.1%) to 13.559% when pulling 6b3763e on linki:forwarded-proto into f768850 on labstack:master.

@vishr vishr self-requested a review February 28, 2017 21:25
@vishr vishr self-assigned this Feb 28, 2017
@vishr vishr merged commit f4b2df4 into labstack:master Feb 28, 2017
@vishr
Copy link
Member

vishr commented Feb 28, 2017

@linki It looks good to me, all the cases you mentioned are valid, however they can be deferred for now. Thanks your you contribution 🎉 .

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants