Safari, So Good, So What!
I rewrote my application to take advantage of the new Restful Urls in Rails (an article on this coming up). I also got rid of the messy session-managed login code and thought I would use a nice and easy HTTP authentication scheme (so my eventual API can use the same mechanism as the main application - plus it minimises that "nasty" server-side state).
All my tests passed. Nice.
I ran through the local application in Camino. Nice.
I capistranoed onto the server. Nice.
I ran through the deployed application in Safari (I wanted to grab some screenshots and I use Shapeshifter - I leave Safari unskinned just for this). Boo! Some of the links didn't work.
I examined production.log. The filter chain has been halted - no yield. I examined the Rails source code. Why is the filter chain being halted? I looked through the HTTP Authentication source code. It looks like it is working correctly. Why are only some links not working? The authentication is obviously working for part of the application.
Then I noticed. It was the new-style Urls that were failing ... http://myserver.com/thingies/34;edit
- it's the semi-colon! A few more tests proved it.
And then the killer. It works fine in IE (both 6 and 7). It works fine in Camino. It works fine in Firefox. It's just Safari. Apple's flagship browser doesn't work with Apple-loving Rails. I then tested in OmniWeb ... no joy there either. So WebKit doesn't like Restful Rails.
A quick search later digs up this article - with a fix. Basically it overrides url_for and examines the User Agent - if it's AppleWebKit then Url-escape the semicolons. My Urls look ugly but at least they work.
No comments:
Post a Comment