Stuck! Manifest.json returns 403

Why is this happening? I checked the chmod (604) but Im fairly sure it isn’t that. Is there anything I need to do in the Grav config so that its recognised? Json is not included in the unsafe protocols, extensions or tags lists.

I’m linking in the base.html.twig, like this:

<link rel="manifest" href="{{ url('theme://assets/manifest.json') }}" />

@penworks,

  • Using fresh Grav with Quark on Windows 11 with Ubuntu 24.04 inside WSL
  • Created file ./user/themes/quark/assets/manifest.json using VSCode
  • Added inside base.html.twig
    <link rel="manifest" href="{{ url('theme://assets/manifest.json') }}" />
  • Generated HTML contains:
    <link rel="manifest" href="/user/themes/quark/assets/manifest.json" />

No errors.

Questions:

  • Is your file’s access permissions equal to other files inside assets or *images"?
  • Is your file’s owner and group equal to other files inside assets or *images"?

Yes the owner is the same. I used Sublime to create the file, on Windows. and sftp using WinSCP. The folder is 705, all the other file permissions are 604, I checked.

@penworks, I had the same issue, you can use the .webmanifest extension insteed,
Grav blocks .json files in web server configs.

@b.da, I’m not that well versed in .htaccess…

The .htaccess in the root folder of Grav has the same restrictions. I use Apache2, instead of the build in webserver and have no issues.

@b.da
Thanks for the link. I thought it must be something like this in the Grav system.

So to clarify, I’d have:

<link rel="manifest" href="{{ url('theme://assets/manifest.webmanifest') }}" />

@penworks, if that’s your file path, you just need to change the file extension manifest.webmanifest instead of manifest.json. In my case {{ url('theme://images/manifest.webmanifest', true) }}

1 Like

@pamtbaau, yes, it’s in the same commit. Not an expert in this part either, although everything seems clear here. I just remember an issue arose, and I quickly found a solution, and thought that blocking seems logical, as Flex Objects specifically use .json format and should not be accessible. You can test access to ../user/data/flex-objects/contacts.json.

1 Like

@b.da
Yes I did that and its now accessible. I’ve actually used site.webmanifest.

Its not working yet as a standalone PWA so I still need to check the content again but the rendered link works.

Thanks!

@penworks, Please mark the reply from @b.da as “solution” since it did solve your issue.

@pamtbaau OK, thanks for reminder. Thanks for your input also as has prompted further useful info.