I am trying to host an external website on Amazon Mechanical Turk (AMT) using an iframe. When I attempt to do this, I receive the following error message:
The resource from “[https://requestersandbox.mturk.com/create/projects/worker-html.js](https://requestersandbox.mturk.com/create/projects/worker-html.js)” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
I am wondering if this is caused by using a REST API (with the MIME type
application/json). If so, is there any way to fix it or work around this issue?
The error message suggests that the MIME types of the resource being loaded in the iframe and the expected MIME type specified in the HTTP header do not match. This could be caused by the REST API returning a MIME type of
To fix this issue, you can try setting the
Content-Type header to
text/html in the REST API response. Alternatively, you can try using a different MIME type that is compatible with both the iframe and the REST API.
Another possible solution is to use a proxy server to load the external website content and then display it in the iframe. This can help avoid MIME type issues and ensure that the content is properly loaded and displayed in the iframe.