! MouseHole 1.2 is out
Ben Schumacher
me at benschumacher.com
Thu Sep 29 12:04:45 EDT 2005
I think it's lower level than just by convention at the HTTP layer. It
probably has more to do with filesystem behavior. I would venture a
guess that nearly all *nix operating systems treat "//" as a single
"/" and I have just confirmed on the Windows box I'm on that it
behaves the same way (and I am certain that FreeBSD does as well). I
think the idea is to be forgiving of users.
That being said, I think it would be nice to pass it through for the
benifit of things like ProxyLike. Maybe we can add the ability to get
the non-normalized URL...?
Just a thought.
bs.
On 9/29/05, Daniel Sheppard <daniels at pronto.com.au> wrote:
> /foo//bar may be equivalent to /foo/bar (I think that's just a
> convention though, not the http spec), but there should be a definite
> difference between /foo%2F%2Fbar and /foo%2Fbar
>
> But it appears that the bug is in Net::HTTP, not mousehole - the extra
> backslash has already be stripped before mousehole gets its paws on
> things.
>
> I'll take the ProxyLike route.
>
> -----Original Message-----
> From: mousehole-scripters-bounces at rubyforge.org
> [mailto:mousehole-scripters-bounces at rubyforge.org] On Behalf Of Kevin
> Ballard
> Sent: Thursday, 29 September 2005 4:02 PM
> To: mousehole-scripters at rubyforge.org
> Subject: Re: ! MouseHole 1.2 is out
>
> I believe it's because /foo//bar and /foo/bar are equivalent URLs, and
> so stripping double-slashes everywhere makes the comparison work better.
>
> If you want to include a URL in the mount, look at what ProxyLike does.
> It registers http: and then just takes the path and pretends it starts
> with //.
>
> On Sep 29, 2005, at 1:59 AM, Daniel Sheppard wrote:
>
> > There's a bug with the paths. In the scripted_mounts method:
> >
> > path_parts = request.path_info.split( '/' ).reject { |x|
> > x.to_s.strip.size == 0 }
> > mount = path_parts.shift.to_s.strip
> > each_fresh_script do |path, script|
> > if mount =~ /^\/*#{ script.mount }$/
> > script.do_mount( path_parts.join( '/' ), request,
> > response
> > )
> > no_cache response
> > return
> > end
> > end
> >
> > Why is the reject { |x| x.to_s.strip.size == 0 } there? It has the
> > consequence that any double forward slash is stripped from the path
> > (so that urls cannot be included in the url for a mount). I take it
> > that it's there to filter out localhost:37004//cmd/ ? Would the
> > following
> > suffice:
> >
> > path_parts = request.path_info.split( '/' )
> > begin
> > mount = path_parts.shift
> > end until mount.to_s.strip.size > 0 || path_parts.empty?
>
> --
> Kevin Ballard
> kevin at sb.org
> http://www.tildesoft.com
> http://kevin.sb.org
>
>
>
> #####################################################################################
> This email has been scanned by MailMarshal, an email content filter.
> #####################################################################################
>
> _______________________________________________
> Mousehole-scripters mailing list
> Mousehole-scripters at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mousehole-scripters
>
More information about the Mousehole-scripters
mailing list