umts / BusInfoBoard

A place to view bus arrival information from Avail's JSON feed
Apache License 2.0
16 stars 3 forks source link

404 error when using StopSelector #34

Closed akaplo closed 8 years ago

akaplo commented 8 years ago

Query string calls work fine, but suddenly github is returning a 404 on mobile devices after making choices with the StopSelector on m.pvta.com. could something have changed about the repository's location?

sherson commented 8 years ago

gh-pages is returning (for example) http://umts.github.io/BusInfoBoard?&mobile=true&stops=64 while http://umts.github.io/BusInfoBoard/?&mobile=true&stops=64 works fine.

The slash is included when I run it locally.

A quick google search yielded some discussions on relative paths and trailing slashes with gh-pages, but nothing I read seems relevant.

Any thoughts @werebus @dfaulken?

werebus commented 8 years ago

So, this appears to have "fixed itself", but it basically boils down to Github's rewrite rules. Currently when you make a GET request to http://umts.github.io/BusInfoBoard?&mobile=true you get a 301:

HTTP/1.1 301 Moved Permanently
Accept-Ranges: bytes
Access-Control-Allow-Origin: *
Age: 0
Cache-Control: max-age=600
Connection: keep-alive
Content-Length: 178
Content-Type: text/html
Date: Mon, 23 Nov 2015 14:48:11 GMT
Expires: Mon, 23 Nov 2015 14:58:11 GMT
Location: http://umts.github.io/BusInfoBoard/?&mobile=true
Server: GitHub.com
Vary: Accept-Encoding
Via: 1.1 varnish
X-Cache: MISS
X-Cache-Hits: 0
X-Fastly-Request-ID: 82d3337ecd1638326941e92c079ef0249294aec4
X-GitHub-Request-Id: C71B4C1E:17E0:5502D39:5653272A
X-Served-By: cache-jfk1029-JFK
X-Timer: S1448290091.071205,VS0,VE18

<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>

It was this redirecting that was broken this weekend.

I think we should probably have the / anyways. Also, a leading & in the query string looks a little odd. I guess it's still valid, but it probably shouldn't be there.