First of all, excuse me for my not so good english. Started to develope a new app a few days ago. Everything seemed to be just fine until I started implementing calls with Ajax.Request. I''m using ASP and I was really surpriced when I couldn''t get my asp script to read POST data. After a lot of reading I''ve found this thread http://groups.google.com/group/rubyonrails-spinoffs/browse_thread/thread/b584fe3e7e943e31/cc1c6328241e0005?lnk=gst&q=apache&rnum=9#cc1c6328241e0005 I looked up the Ajax.Request and the setRequestHeaders() function and removed the url-encoding stuff from the "content-type" header. Like this: Before change: On line 1070: headers[''Content-type''] = this.options.contentType + (this.options.encoding ? ''; charset='' + this.options.encoding : ''''); After change: headers[''Content-type''] = this.options.contentType; And then it worked like a charm. I''m not sure if this had something to do with my Apache installation and mod_security because there was no info in the logs. My Apache version is 2.0.52. Someone else experience in these problems? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-May-16 06:17 UTC
Re: Found a bug in Prototype 1.5.1_rc4 regarding Ajax.Request
elmaco a écrit :> I looked up the Ajax.Request and the setRequestHeaders() function and > removed the url-encoding stuff from the "content-type" header. Like > this:Patching Prototype to circumvent issues from your code is probably not the best way to go... - What defines the parameters for your Ajax.Request? Do you use, as intended, the parameters option? Do you leave it to Prototype to properly encode them as UTF-8 (which you should), or do you manually produce a non-UTF-8-string, which then breaks because the default value for the encoding option *is* UTF-8? -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
elmaco
2007-May-16 21:54 UTC
Re: Found a bug in Prototype 1.5.1_rc4 regarding Ajax.Request
Yes, I use the parameters option. I have written a test program in both asp and php that works exactly the same. in php it works, but not in asp. I''m using Sun ChildCode ASP btw. So maybe it something different between microsoft and chilicode asp regarding requests. Test it yourself. To understand you should use Firebug to inspect the post parameters in the http request. With prototype.js (1.5.1_rc4) unchanged: http://elmaco.homeip.net/administrationen2.0/test.asp http://elmaco.homeip.net/administrationen2.0/test.php With prototype.js (1.5.1_rc4) and my changes: http://elmaco.homeip.net/administrationen2.0/test_fix.asp http://elmaco.homeip.net/administrationen2.0/test_fix.php On May 16, 8:17 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> - What defines the parameters for your Ajax.Request? Do you use, as > intended, the parameters option? Do you leave it to Prototype to > properly encode them as UTF-8 (which you should), or do you manually > produce a non-UTF-8-string, which then breaks because the default value > for the encoding option *is* UTF-8?--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Christophe Porteneuve
2007-Jun-15 11:39 UTC
Re: Found a bug in Prototype 1.5.1_rc4 regarding Ajax.Request
From your test case, it would appear that Sun''s ChildCode ASP does not properly handle URL-encoding of POST requests, which is extremely alarming (and must therefore not be quite true, but your code must have hit a related snag). If you look at your test page with original Proto and PHP backend, it works just fine. From what Firebug tells me, the request in ASP mode with original Proto is also perfectly nominal, and should be processed properly (I tried with alternate Rails and Servlet backends here on my box, using your client side, and it works, too). You might want to search for ChildCode bugs on Google or whatever (ChildCode may have a Trac/Bugzilla/JIRA available somewhere for tickets). -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---