YaleSTC / shifts

Application to easily track shifts, reports, and payforms for employees.
MIT License
23 stars 18 forks source link

Calendar feeds inaccessible #478

Closed shippy closed 9 years ago

shippy commented 9 years ago

As per today's and yesterday's stc-social, calendar feeds are inaccessible. @dgoerger's diagnostic suggests this is because iCal / other calendar feeds are running into a CAS barrier.

[deg38@localhost ~]$ curl -I http://shifts.yale.edu/stc/calendar_feeds/grab/1/%5B%2256e1b04e8ce92eddd5107cf1d18f65c0%22%5D.ics
HTTP/1.1 302 Found
Date: Mon, 24 Aug 2015 12:12:49 GMT
Server: Apache
X-UA-Compatible: IE=Edge,chrome=1
Cache-Control: no-cache
X-Request-Id: 7974cbc580c4b41b7ac3f95c06c2de67
X-Runtime: 0.081523
X-Rack-Cache: miss
X-Powered-By: Phusion Passenger 4.0.38
Set-Cookie: _shifts_session=BAh7CUkiD3Nlc3Npb25faWQGOgZFVEkiJWQ4ZGRhMWRkYWJlMmM1NzUwNDUxZjQ1NWJlZmE4YTA3BjsAVEkiGGNhc19zZW50X3RvX2dhdGV3YXkGOwBGRkkiH2Nhc192YWxpZGF0aW9uX3JldHJ5X2NvdW50BjsARmkASSIdcHJldmlvdXNfcmVkaXJlY3RfdG9fY2FzBjsARkl1OglUaW1lDQzfHICXihMzCjoNbmFub19udW1pAnIDOg1uYW5vX2RlbmkGOg1zdWJtaWNybyIHiCA6C29mZnNldGn%2BwMc6CXpvbmVJIghFRFQGOwBU--9bb17340aa5e396e4b1a8fb24726b3e2bdb39770; path=/; HttpOnly
Location: https://secure.its.yale.edu/cas/login?service=http%3A%2F%2Fshifts.yale.edu%2Fstc%2Fcalendar_feeds%2Fgrab%2F1%2F%255B%252256e1b04e8ce92eddd5107cf1d18f65c0%2522%255D.ics
Status: 302 Found
Connection: close
Content-Type: text/html; charset=utf-8
shippy commented 9 years ago

Pushed a PR. Ordinary skip_before doesn't seem to work for RubyCAS::Filter (as documented in rubycas/rubycas-client#54), hence the ugly fix in ApplicationController (adding grab directly there). Since there is no other controller action named grab, this should be fine.