Closed jannikolai closed 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.
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.
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.
Good suggestion. Ring headers are just passed in a map, so this is mostly a matter of setting up the infrastructure.
I already added the "x-forwarded-proto" "https" in the Proxy config.
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 :-).
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.
What kind of links? Absolute ones?