Ajax and Sahi

Posted by | June 13, 2007 | Support, Tutorial | One Comment


In Sahi, some javascript is added to all pages. In an ajax call, the response should be xml. But sahi may taint the xml with its javascript and hence ajax calls may stop working. Sahi looks at the content type of a file before it injects its js, but most of the time the ajax responses also have the content type as text/html


Sahi can be asked to not inject js into requests whose urls follow specific patterns.
Say urls which have say “/ajax/” in them can be excluded from injection.

What you need to do is add the regular expression pattern of the ajaxy urls to config/exclude_inject.txt
so if your url is something like
http://www.example.com/ajax/list.html” use
“.*/ajax/.*” (without quotes) to match all urls with /ajax/ in them and exclude them from js injection.

SSL/https with Sahi
Toggling Proxy on Browsers

One Comment

Leave a Reply

Your email address will not be published.

Use fully-loaded Sahi Pro FREE for a month. Download Now Request a Demo