aaronpk / IndieAuth.com

This service is being discontinued in favor of indielogin.com
https://indieweb.org/indieauth.com
184 stars 32 forks source link

Resolve relative redirect URLs #46

Closed aaronpk closed 10 years ago

aaronpk commented 10 years ago

Sometimes, http://bret.io sends a 301 redirect to / which means the schemes don't match and IndieAuth halts. Instead, the IndieAuth server should resolve the relative redirect location.

bcomnes commented 10 years ago

Also note this appears to be an issue with GH-pages hosting on github.

bcomnes commented 10 years ago

Ok I think I figured this one out.... sort of.

It looks like github changed the IP addresses that you need to point your domain to when using a naked url: https://github.com/blog/1715-faster-more-awesome-github-pages

The old IP that I was pointing too still worked though, for the most part, besides the issue noted here. I'm guessing it has to do with their efforts to not totally break github pages during the transition.

Adding the two updated IP addresses to A records on my DNS seems to stopped all 301 redirects to / as far as I can tell. See this article for up to date information about how GH asks you to configure your DNS settings. https://help.github.com/articles/setting-up-a-custom-domain-with-pages#apex-domains

Furthermore, GH is promoting the idea of an ALIAS DNS record, which is sort of like an a cross between an A record and a CNAME. Read GH's take on them in the first article, but its also worth noting other opinions on the matter as well: https://iwantmyname.com/blog/2014/01/why-alias-type-records-break-the-internet.html

@aaronpk Would ALIAS records work with indieauth? I don't have a capable DNS for testing myself at the moment.

aaronpk commented 10 years ago

The critique of ALIAS records seems a bit over-dramatic to me. Currently as you noted, there is no better way of handling pointing root domains to services like Github pages. Either you update the IP address when Github changes things, or you let your DNS provider do so with the ALIAS record. Also have you seen the crazy tricks AWS pulls with aliasing names to their ELBs?

Anyway, you should have no problem using the ALIAS record with IndieAuth.

Also I'm leaving this issue open because it should still resolve the relative redirect URLs.

skinny97214 commented 10 years ago

This is affecting my domain crystalbeasley.com on github pages which serves from my root account http://skinny97214.github.io/

bcomnes commented 10 years ago

The above DNS fix seems to have improved the situation, but I am still running into a similar error. Since the resolving to / seems to be dependent on some kind of cache timing, it makes it hard to test. I'll post more when I find out more.

aaronpk commented 10 years ago

Pushed up a change today which should fix this for good! Let me know if you continue to have problems.

bcomnes commented 10 years ago

So far so good.