togakangaroo / coa-nolahealth-mobile

Code For America HackDay Nola Health Mobile app
3 stars 3 forks source link

Mobile devices not getting correct view #1

Closed rcschafer closed 12 years ago

rcschafer commented 12 years ago

reported by George Mauer

Hmm, well it's the most recent version now except that when accessing it from my android the site looks like crap - it's not recognizing it as mobile or something and starts all zoomed out. My local rails server is running the exact same code and when I hit it from my phone it looks great.

Do you guys have any ideas? Server configuration is a bit out of my wheelhouse.

Here are the headers I'm receiving from heroku (which looks weird)

Request URL:    http://falling-earth-8872.herokuapp.com/
Request Method: GET
Status Code:    304 Not Modified

Request Headers

Accept:            text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:    ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:   gzip,deflate,sdch
Accept-Language:   en-US,en;q=0.8
Cache-Control:     max-age=0
Connection:        keep-alive
Host:              falling-earth-8872.herokuapp.com
If-Modified-Since: Sun, 26 Feb 2012 21:22:02 GMT
User-Agent:        Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.7 (KHTML, like Gecko) Ubuntu/11.10 Chromium/16.0.912.77 Chrome/16.0.912.77 Safari/535.7

Response Headers

Age:              0
Connection:       keep-alive
Date:             Sun, 26 Feb 2012 21:26:56 GMT
Server:           thin 1.3.1 codename Triple Espresso
X-Content-Digest: 118195c74fccada54f8895318758a4a1004c5f4a
X-Rack-Cache:     stale, valid, store

Here are the headers for localhost (which looks good)

Request URL:     http://localhost:3000/
Request Method:  GET
Status Code:     304 Not Modified

Request Headers

Accept:          text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:  ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cache-Control:   max-age=0
Connection:      keep-alive
Cookie:          _nolahealth-mobile_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTgzOGE4MjllZTBlMWQ1MjljM2IyZDg1ODI3YTM0NmRmBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMWxob3V1eHMyZWNVTUVGakJWOURhaURtMEorSnBiMVRrNlBSR21ydlEvL289BjsARg%3D%3D--6065213642a645e0fa37c48bbae0585d79096d57
Host:            localhost:3000
If-None-Match:   "1f9d520d99d057a4d9b63e23850d31d3"
User-Agent:      Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.7 (KHTML, like Gecko) Ubuntu/11.10 Chromium/16.0.912.77 Chrome/16.0.912.77 Safari/535.7

Response Headers

Cache-Control:   max-age=0, private, must-revalidate
Connection:      close
ETag:            "1f9d520d99d057a4d9b63e23850d31d3"
Server:          thin 1.3.1 codename Triple Espresso
Set-Cookie:      _nolahealth-mobile_session=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJTgzOGE4MjllZTBlMWQ1MjljM2IyZDg1ODI3YTM0NmRmBjsAVEkiEF9jc3JmX3Rva2VuBjsARkkiMWxob3V1eHMyZWNVTUVGakJWOURhaURtMEorSnBiMVRrNlBSR21ydlEvL289BjsARg%3D%3D--6065213642a645e0fa37c48bbae0585d79096d57; path=/; HttpOnly
X-Request-Id:    a810765bd69057fa32a76ca0cd57653f
X-Runtime:       0.027176
X-UA-Compatible: IE=Edge
rcschafer commented 12 years ago

Summing up the differences:

Fieldherokulocalhost
Cookie
--
_nolahealth-mobile_session=BAh7B0kiD...
If-Modified-Since
Sun, 26 Feb 2012 21:22:02 GMT
--
If-None-Match
--
"1f9d520d99d057a4d9b63e23850d31d3"
Fieldherokulocalhost
Age
0
--
Connection
keep-alive
close
Date
Sun, 26 Feb 2012 21:26:56 GMT
--
X-Content-Digest
118195c74fccada54f8895318758a4a1004c5f4a
--
X-Rack-Cache
stale, valid, store
--
Cache-Control
--
max-age=0, private, must-revalidate
ETag
--
"1f9d520d99d057a4d9b63e23850d31d3"
Set-Cookie
--
_nolahealth-mobile_session=BAh7B0kiD...
X-Request-Id
--
a810765bd69057fa32a76ca0cd57653f"
X-Runtime
--
0.027176
X-UA-Compatible
--
IE=Edge
rcschafer commented 12 years ago

I suspect this has something to do with the default Rails session management technique; perhaps it's supported on local machines but not on heroku instances (which probably don't support anything that needs to write to a filesystem.)