3

I'm dealing with a system where the Quick Search box is not working. Using the browser dev tools shows ajax requests being sent but receiving a '406 Not acceptable' error.

According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406 this relates to content negotiation.

The AJAX URL is:

https://example.com/administrator/?option=com_civicrm&task=civicrm/ajax/rest&entity=contact&action=getquick&json={"name":"a","field_name":"","table_name":"cc"}

and the content negotiation headers in the request are:

Accept: application/json, text/javascript, */*; q=0.01
Accept-Encoding: gzip, deflate, br
Accept-Language: en-GB,en;q=0.5

This matches what I see on another system that is working normally.

This is CiviCRM 5.5.2 on Joomla 3.8.13

Any ideas?

0

1 Answer 1

0

Does the webserver support compression? Might be a disabled module (e.g. mod_gzip in apache). The Accept-Encoding suggests only compressed data is accepted.

3
  • Thanks - I've tried changing the Accept-Encoding header to various things including * and all fail. On a different system I've also tried the same changes and I can't get that to fail so I'm wondering with it really is a 406 or something else that is wrongly identifying.
    – Aidan
    Commented Nov 29, 2018 at 18:11
  • If you're seeing a 406 status, I do think it'll be coming from your webserver or Joomla and not CiviCRM. CiviCRM's HTTP response code vocab doesn't include 406 AFAIK. Any of those Accept* headers could trigger a 406 if the application couldn't satisfy them. Commented Nov 29, 2018 at 18:44
  • Maybe a .htaccess file that is weird. It's possible for mod_rewrite for example to be told to return 406 for certain url patterns. Or maybe mod_security blocking it and returning 406.
    – Demerit
    Commented Nov 29, 2018 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.