Search code examples
jsongithubcontent-typefirefox-os

Validation error while submitting app to Firefox Marketplace


I was validating my manifest on this page with this manifest URL of my app hosted on GitHub:

https://raw.githubusercontent.com/my_username/my_application/master/manifest.webapp

This is the error I got:

Manifests must be served with the HTTP header "Content-Type: application/x-web-app-manifest+json". See https://developer.mozilla.org/docs/Web/Apps/Manifest#Serving_manifests for more information.

So I checked that link mentioned in the error and it says:

If you serve your manifest file from GitHub Pages, GitHub will serve it with the Content-Type header of application/x-web-app-manifest+json.

Assuming that I need to create a GitHub page for my app, I created it and passed on that link to validate. Then I got 2 errors:

  1. JSON Parse Error
  2. Manifests must be served with the HTTP header "Content-Type: application/x-web-app-manifest+json". See https://developer.mozilla.org/docs/Web/Apps/Manifest#Serving_manifests for more information.

My JSON is valid, I had it checked on jsLint. Also, I am assuming that the GitHub page is passing on the required header when I am giving the respective URL. Still it's failing.

How do I fix this?


Solution

  • You are not serving this manifest over GitHub pages, but as 'Raw' content. All content on raw.githubusercontent.com is served as text/plain.

    Use real Github pages to make this work.