XPath AutoComplete Call to GetData uses GET instead of POST
I have recently upgraded a site that I have previously inherited to Umbraco v6.2.5. One issue that has been raised is that the XPath Autocomplete feature has stopped working. I've been doing some digging and a null reference exception is being thrown because autoCompleteText returns null in the HttpContext.Current.Request.Form collection. The reason why is because the call to GetData in XPathAutoCompleteBase is using GET instead of the POST method.
I dug a little deeper and stepped through some of the JS and found that the request is initiated with a POST as follows but it is somehow converted and I can see in the browser inspector that it is actually made as GET.
As usual after posting I think I can answer this myself as shortly after it triggered a thought process which I think has led me to identify the source of the issue.
In case it is of help to others I believe the cause to be a rewrite rule for adding a trailing slash to all urls. It causes a redirect and subsequently loses the post data and results in a GET rather than POST.
Here is the amended rule which now works around the issue:
XPath AutoComplete Call to GetData uses GET instead of POST
I have recently upgraded a site that I have previously inherited to Umbraco
v6.2.5
. One issue that has been raised is that the XPath Autocomplete feature has stopped working. I've been doing some digging and a null reference exception is being thrown becauseautoCompleteText
returns null in theHttpContext.Current.Request.Form
collection. The reason why is because the call toGetData
inXPathAutoCompleteBase
is usingGET
instead of thePOST
method.I dug a little deeper and stepped through some of the JS and found that the request is initiated with a
POST
as follows but it is somehow converted and I can see in the browser inspector that it is actually made asGET
.Has anyone come across this before or have any ideas how or why this might be getting converted?
Thanks, Simon
As usual after posting I think I can answer this myself as shortly after it triggered a thought process which I think has led me to identify the source of the issue.
In case it is of help to others I believe the cause to be a rewrite rule for adding a trailing slash to all urls. It causes a redirect and subsequently loses the post data and results in a GET rather than POST.
Here is the amended rule which now works around the issue:
Hopefully this might help someone else.
is working on a reply...