Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ sahipro.com with your query.

Issue with HEAD HTTP request

tdeblocktdeblock Members
edited January 2015 in Sahi - Open Source
Hello,

I have an critical issue with Sahi. My application use HEAD HTTP request to know if I can do Ajax request.
Without sahi, all is ok.
But when i activate sahi ajax call is not do.

I have found why. It's because when a HEAD HTTP query is do sahi return a mocked header repsponse, not the header retourned by the server.

This is the header when sahi is not running : http://hpics.li/37a32b9
This is the header when sahi is running : http://hpics.li/394dc79

I have correct the issue. For that I have update the net.sf.sahi.request.HttpRequest class :
- I have add a method :
public boolean isHead() {
return "head".equalsIgnoreCase(method());
}
- i have update the if line 86 :
before :
if (isPost() || isGet() || isPut() || isDelete() || isConnect()) {
setHostAndPort();
setUri();
setQueryString();
}
after
if (isPost() || isGet() || isPut() || isDelete() || isConnect() || isHead()) {
setHostAndPort();
setUri();
setQueryString();
}

My correction is do on the v5 release.

Comments

Sign In or Register to comment.