Mat Schaffer
2008-Mar-15 13:54 UTC
[Mechanize-users] [PATCH] Get requests with non-html referers
Hey, Aaron. Looks like that get with hash params patch you checked in had some side effects. Specifically, you''re testing if a referer is a Page (mechanize.rb:171), but the referer could also be a WWW::Mechanize::File. Like if the last page loaded was xml. Here''s a patch that addresses the issue. Thanks again, Mat -------------- next part -------------- A non-text attachment was scrubbed... Name: mechanize_get_with_file_as_referer.patch Type: application/octet-stream Size: 1238 bytes Desc: not available Url : http://rubyforge.org/pipermail/mechanize-users/attachments/20080315/a4157e46/attachment.obj -------------- next part --------------
Aaron Patterson
2008-Mar-15 15:08 UTC
[Mechanize-users] [PATCH] Get requests with non-html referers
On Sat, Mar 15, 2008 at 09:54:54AM -0400, Mat Schaffer wrote:> Hey, Aaron. Looks like that get with hash params patch you checked in had > some side effects. Specifically, you''re testing if a referer is a Page > (mechanize.rb:171), but the referer could also be a WWW::Mechanize::File. > Like if the last page loaded was xml. Here''s a patch that addresses the > issue.Ya. I was just looking at this last night. Thanks for the patch! I''ve applied it, and I will release now. -- Aaron Patterson http://tenderlovemaking.com/
Mat Schaffer
2008-Mar-17 01:29 UTC
[Mechanize-users] [PATCH] Get requests with non-html referers
On Mar 16, 2008, at 12:08 AM, Aaron Patterson wrote:> Ya. I was just looking at this last night. Thanks for the patch! > I''ve > applied it, and I will release now.Cool! I was also getting the impression that the whole referer section should be reworked to use the uri of current_page, rather than current_page directly. Just side-step this whole thing. But I didn''t know what your plans were surrounding that "Huge hack" where so I stuck with the simple solution. Thanks! Mat
Aaron Patterson
2008-Mar-17 14:49 UTC
[Mechanize-users] [PATCH] Get requests with non-html referers
On Mon, Mar 17, 2008 at 10:29:41AM +0900, Mat Schaffer wrote:> On Mar 16, 2008, at 12:08 AM, Aaron Patterson wrote: > > Ya. I was just looking at this last night. Thanks for the patch! > > I''ve > > applied it, and I will release now. > > Cool! I was also getting the impression that the whole referer > section should be reworked to use the uri of current_page, rather than > current_page directly. Just side-step this whole thing. But I didn''t > know what your plans were surrounding that "Huge hack" where so I > stuck with the simple solution.Yes. I headed down the direction of reworking the referer section to use the URI rather than the current page. Unfortunately I ran into a problem.... IIRC, the problem was taking into account the HTML base tag. I think it won''t be too much work to factor out the base tag stuff, I just wanted to get that change out quickly. I''ll take another stab at refactoring that in a week or two. I''ve got a cold, so I''m trying to take it easy for a bit. :-) -- Aaron Patterson http://tenderlovemaking.com/
Mat Schaffer
2008-Mar-18 23:32 UTC
[Mechanize-users] [PATCH] Get requests with non-html referers
On Mar 17, 2008, at 11:49 PM, Aaron Patterson wrote:> Yes. I headed down the direction of reworking the referer section to > use the URI rather than the current page. Unfortunately I ran into a > problem.... IIRC, the problem was taking into account the HTML base > tag. I think it won''t be too much work to factor out the base tag > stuff, I just wanted to get that change out quickly.Yeah that''s exactly the sort of thing I figured you had a better handle on than I. Honestly I didn''t even discover the base tag till like last week.> I''ll take another stab at refactoring that in a week or two. I''ve > got a > cold, so I''m trying to take it easy for a bit. :-)I hear you there. Just came of a 3 day stomach flu myself. Rest up and take it easy. -Mat