Issues with replacing images in the panel

Hi there,

I’m stuck with two issues, which may or may not be related, when replacing images in the panel.

The website is not public yet.

Issue one, happening on local and staging environments:

When trying to replace an image in the panel, from the file preview page, the process works as expected but the preview is not updated until I manually refresh the page. I get no error message, whether in the panel or in the browser console.

If I do the same thing from a files section it works as expected.

Issue 2, happening on staging environment only:

When I try to replace an image, whether from a files section or from the file preview page, it does not get replaced at all. Everything seems ok until I click “Replace” in the dialog, after uploading the new file. I get no error message in the panel, but a “406 not acceptable” in the browser console.

The accept headers I can see in the browser’s network tab are:

accept */*

accept-encoding gzip, deflate, br, zstd

accept-language fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7

“Type” is marked as “xhr”.

If I disable ModSecurity for the staging domain I am left with issue 1 described above.

I’ve been searching for similar issues happening to others, but I am stuck.

Can anyone point me in the right direction?

System info (for both environments):

{
  "info": {
    "kirby": "5.1.4",
    "php": "8.3.27",
    "server": "Apache",
    "license": "Non enregistré",
    "languages": []
  },
  "security": [],
  "plugins": [
    {
      "name": "bvdputte/fingerprint",
      "version": "2.2.5"
    },
    {
      "name": "emue/staying-accessible",
      "version": "1.0.0"
    },
    {
      "name": "junohamburg/visual-block-selector",
      "version": "3.0.1"
    },
    {
      "name": "plain/column-block",
      "version": "1.2.7"
    },
    {
      "name": "tobimori/icon-field",
      "version": "2.3.0"
    }
  ]
}

@texnixe, anyone ?

Can I provide some more context or info?