innoq / statuses

statuses
Apache License 2.0
13 stars 14 forks source link

Links in Feed start with http://... also when statuses is hosted on https #39

Closed jannikolai closed 11 years ago

stilkov commented 11 years ago

What kind of links? Absolute ones?

jannikolai commented 11 years ago

I mean the absolute one in an entry element.

<entry>
    <link href="http://.../statuses/updates/515"/>
</entry>

But also the link with rel="self" does not contain the https in the link.

stilkov commented 11 years ago

OK, at least I think I know the reason: The URI scheme is extracted from the ring request, and as the app is deployed using HTTP (accessed locally) and then proxied through HTTPS, this doesn't match.

The solution most likely to work is to make the base URI configurable via the config mechanism. I'll do it sometime unless someone else wants to play around and give it a try.

martinei commented 11 years ago

A typicall solution is to evaluate the de factor standard header "X-Forwarded-Proto" and configure the reverse proxy to set it. This is has the advantage of beeing functionall for hybrid sites served over http AND https at the same time (I'd prever https only, but the debate around SPDY show I am quitte the only one :-)). On the other hand the benefit for configurable URI is that it will also handle path prefixes added by the reverse Proxy. The "ultimate" solution would be a x-forwarded-requestUri (x-forwared-proto + x-forwarded-path + host) , but I am not aware of any such common convention. One should if check if ring possible already support x-forwarded-proto.

stilkov commented 11 years ago

Good suggestion. Ring headers are just passed in a map, so this is mostly a matter of setting up the infrastructure.

offlinehoster commented 11 years ago

I already added the "x-forwarded-proto" "https" in the Proxy config.

phaus commented 11 years ago

Maybe https://github.com/noir-clojure/lib-noir/blob/master/src/noir/util/middleware.clj#L59-L68 gives some hint. Although statuses does not use noir middleware. I guess that's a sign of maturity if there is some middleware for something :-D. Might try to fix it myself if i have time to dig into clojure, just to make pagination work again :-).

stilkov commented 11 years ago

It just needs to be done, there's not theoretical problem to solve here. Give it a shot if you want, otherwise I'll try to do it next time I spend some time with the app.