Change Content-Type to application/json for the application firewall be happy.
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3547500. -->
Reported by: [rondev](https://www.drupal.org/user/59615)
Related to !1178
>>>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>I don't get answer from AI when asking from CKeditor.<br>
All I get as a response is:</p>
<pre>Forbidden<br><br>You don't have permission to access this resource.</pre><p>
I don't even have something logged in /admin/config/ai/logging/collection<br>
I receive a 403 .<br>
The webserver logs:<br>
<code>[Tue Sep 23 23:11:10 2025] [error] [client myipaddress] ModSecurity: Access denied with code 403 (phase 2). Match of "within %{tx.allowed_request_content_type}" against "TX:0" required. [file "/usr/local/apache2/conf/modsecurity/base_rules/modsecurity_crs_30_http_policy.conf"] [line "63"] [id "960010"] [msg "Request content type is not allowed by policy"] [data "text/plain"] [severity "WARNING"] [tag "POLICY/ENCODING_NOT_ALLOWED"] [tag "WASCTC/WASC-20"] [tag "OWASP_TOP_10/A1"] [tag "OWASP_AppSensor/EE2"] [tag "PCI/12.1"] [hostname "www.mydomain.com"] [uri "/api/ai-ckeditor/request/content_format/ai_ckeditor_spellfix"] [unique_id "aNMM7hxXZF3mRYse1bJuyAAAAjg"]</code></p>
<h4 id="summary-steps-reproduce">Steps to reproduce (required for bugs, but not feature requests)</h4>
<p>AI provider: OpenAI, Mistral<br>
Activate the application firewall on my hosting provider (OVH)<br>
Tested tools for CKEditor: Fix spelling and Modify with a prompt<br>
When I try the CKEditor AI tools I got a 403 POST, nothing is logged in /admin/reports/dblog nor in /admin/config/ai/logging/collection .</p>
<p>I manage to send Request and get Responses with AI API Explorers / Chat Generation Explorer. And they are logged in /admin/config/ai/logging/collection</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Change the Content-type of the request from <code>text/plain</code> to <code>application/json</code> as it works with AI API explorer.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>I tried to modify the code without much success.</p>
<h3>Optional: Other details as applicable (e.g., User interface changes, API changes, Data model changes)</h3>
issue