Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
HTTP Authentication in Safari is broken for RESTful Rails
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Thijs van der Vossen  
View profile  
 More options Nov 24 2006, 2:35 pm
From: Thijs van der Vossen <t.vandervos...@gmail.com>
Date: Fri, 24 Nov 2006 20:35:32 +0100
Local: Fri, Nov 24 2006 2:35 pm
Subject: [offtopic] HTTP Authentication in Safari is broken for RESTful Rails
There's currently a bug in Safari, or more likely somewhere in the OS  
X HTTP API that breaks HTTP Authentication when there is a semicolon  
in the path part of the URL. This means it's impossible to use HTTP  
Authentication when you're building a RESTful Rails app that needs to  
work in Safari.

More details can be found at http://bugs.webkit.org/show_bug.cgi?
id=10073

There's a test page at http://onautopilot.com/test;webkit that should  
ask you for a username and a password.

Right now this still seems to be broken in Leopard. It would be great  
if somebody who knows the right people inside Apple could try to  
raise awareness of this issue. It would be somewhat ironic if Leopard  
Server ships with Rails while this is still broken.

Kind regards,
Thijs


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[offtopic] HTTP Authentication in Safari is broken for RESTful Rails" by Tim Lucas
Tim Lucas  
View profile  
 More options Nov 24 2006, 6:01 pm
From: Tim Lucas <t.lu...@toolmantim.com>
Date: Sat, 25 Nov 2006 10:01:15 +1100
Local: Fri, Nov 24 2006 6:01 pm
Subject: Re: [Rails-core] [offtopic] HTTP Authentication in Safari is broken for RESTful Rails
On 25/11/2006, at 6:35 AM, Thijs van der Vossen wrote:

> There's currently a bug in Safari, or more likely somewhere in the OS
> X HTTP API that breaks HTTP Authentication when there is a semicolon
> in the path part of the URL. This means it's impossible to use HTTP
> Authentication when you're building a RESTful Rails app that needs to
> work in Safari.

I stumbled across this in September, and it required this ugly, ugly  
work around:
http://toolmantim.com/article/2006/9/19/
safari_urls_the_semi_colon_and_one_night_in_paris

Thanks for raising the issue properly and trying to get it addressed.

-- tim


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thijs van der Vossen  
View profile  
 More options Nov 29 2006, 8:09 am
From: Thijs van der Vossen <t.vandervos...@gmail.com>
Date: Wed, 29 Nov 2006 14:09:37 +0100
Local: Wed, Nov 29 2006 8:09 am
Subject: Re: [Rails-core] Re: [offtopic] HTTP Authentication in Safari is broken for RESTful Rails
On Nov 25, 2006, at 12:01 AM, Tim Lucas wrote:

> On 25/11/2006, at 6:35 AM, Thijs van der Vossen wrote:
>> There's currently a bug in Safari, or more likely somewhere in the OS
>> X HTTP API that breaks HTTP Authentication when there is a semicolon
>> in the path part of the URL. This means it's impossible to use HTTP
>> Authentication when you're building a RESTful Rails app that needs to
>> work in Safari.

> I stumbled across this in September, and it required this ugly, ugly
> work around:
> http://toolmantim.com/article/2006/9/19/
> safari_urls_the_semi_colon_and_one_night_in_paris

> Thanks for raising the issue properly and trying to get it addressed.

Great idea to try escaping the semicolon!
For those interested, you can work around this issue by adding the  
following to your ApplicationController in app/controllers/
application.rb:

   # make HTTP Authentication work on Safari for RESTful Rails
   alias_method :orig_url_for, :url_for
   def url_for(options = {}, *parameters_for_method_reference)
     result = orig_url_for(options, parameters_for_method_reference)
     if request.env['HTTP_USER_AGENT'].to_s.include? 'AppleWebKit'
       result.is_a?(String) ? result.gsub(';', '%3B') : result
     else
       result
     end
   end

Kind regards,
Thijs


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jamis Buck  
View profile  
 More options Nov 29 2006, 10:11 am
From: Jamis Buck <ja...@37signals.com>
Date: Wed, 29 Nov 2006 08:11:42 -0700
Local: Wed, Nov 29 2006 10:11 am
Subject: Re: [Rails-core] Re: [offtopic] HTTP Authentication in Safari is broken for RESTful Rails

On Nov 29, 2006, at 6:09 AM, Thijs van der Vossen wrote:

Very nice, Thijs. A minor nitpick, and nothing to do with the actual  
solution: when overriding a method in a subclass, you can just call  
'super' to get at the original. You don't actually need to alias the  
original. The alias trick is only needed when you are altering a  
method of the current class. For instance, if you were monkeypatching  
a new url_for implementation into ActionController::Base itself,  
you'd need to use alias there to preserve the original url_for.

- Jamis Buck
ja...@37signals.com

  smime.p7s
3K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Lucas  
View profile  
 More options Nov 29 2006, 8:48 pm
From: Tim Lucas <t.lu...@toolmantim.com>
Date: Thu, 30 Nov 2006 12:48:04 +1100
Local: Wed, Nov 29 2006 8:48 pm
Subject: Re: [Rails-core] Re: [offtopic] HTTP Authentication in Safari is broken for RESTful Rails
On 30/11/2006, at 12:09 AM, Thijs van der Vossen wrote:

Thanks Thijs, updated accordingly (with slightly cleaner code):
http://toolmantim.com/article/2006/9/19/
safari_urls_the_semi_colon_and_one_night_in_paris

-- tim


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thijs van der Vossen  
View profile  
 More options Nov 30 2006, 4:05 am
From: Thijs van der Vossen <t.vandervos...@gmail.com>
Date: Thu, 30 Nov 2006 10:05:15 +0100
Local: Thurs, Nov 30 2006 4:05 am
Subject: Re: [Rails-core] Re: [offtopic] HTTP Authentication in Safari is broken for RESTful Rails

On Nov 29, 2006, at 4:11 PM, Jamis Buck wrote:

At first I tried to call super as Tim did, but I ended up with an url  
without the ';edit' part while using the url helpers generated by  
ActionController::Resources.

I've looked into this again and it seems that I need to explicitly  
pass the parameters to super to make it work. Like this:

   def url_for(options = {}, *parameters_for_method_reference)
     result = super(options, parameters_for_method_reference)
     if request.env['HTTP_USER_AGENT'].to_s.include? 'AppleWebKit'
       result.is_a?(String) ? result.gsub(';','%3B') : result
     else
       result
     end
   end

My understanding of super was that it passed the original method's  
parameters, but maybe not in this case.

Kind regards,
Thijs

  PGP.sig
< 1K Download

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google