AppCache mime type with IIS7 - iis-7

We're hosting a couple of HTML5 games that utilise the offline.appcache feature letting games cache a lot better.
To serve the .appcache type however, I had to add the mime type to the server (IIS7) so it wouldn't 404. When I do, it refuses to serve any images or CSS files! The error sent to the browser when I request a CSS or image file is:
The page cannot be displayed because an internal server error has occurred.
The extension I am adding is appcache with the MIME type text/cache-manifest.
Any ideas why it's causing this behaviour?

Finally figured it out, I added the mime type on server level not site level. One of the sites already had that mime type defined. Which caused a conflict. But bizarrely the site with the dual definition was fine, it was the other sites that failed.

I ran into a similar issue when adding the .appcache. All .js and .css file requests responded with an error from IIS. I realized it was because I had not specified a NETWORK: section.
My working .appcache now forces all files to be refreshed and doesn't cause errors:
CACHE MANIFEST
# cache version 1.0.0.6
NETWORK:
*

Related

Using an I-frame on mechanical turk HIT?

I'd like to host an external website on AMT using an iframe and allow users to answer to respond on the website. However, I get the following error:
The resource from “https://requestersandbox.mturk.com/create/projects/worker-html.js” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
Could this be caused by the use of a rest API (application/json)? If so, is there a way of fixing it or some work around?
Are you using Express to host the external website? This answer seems to have the same error message and recommends a fix: https://stackoverflow.com/a/45119502/2601671
Also, the URL https://requestersandbox.mturk.com/create/projects/worker-html.js doesn't exist on the MTurk site. Is this a file you expect to have on your server?

After migrating WordPress website, got a new error when trying to view some images

I've just migrated a website live, and some images are coming up with a strange error:
"Error occured while calculating source (passed through env): No image roots defined in config."
Example URL: https://piktochart.com/wp-content/uploads/2019/07/Template-09-Lead-gen-handbook.jpg
Anyone seen this before?
This is only happening on some of the images. I cannot find the cause, I've disabled/re-enabled caching.
I've downloaded the images from the server and they look fine.
I have faced this issue on my own site,I managed, as well.
You can use a plugin that manipulates images, such as WebP Express? Check your htaccess file for rewrite rules involve jpg or png files. I used the above plugin, but it was disabled and the htaccess rules were left in place; trying to redirect images to a page that it couldn’t handle.
For me it was caused by Webp Express, the plugin also gave a notice: It seems your server setup does not support headers in .htaccess. You should either fix this (install mod_headers) or deactivate the "Enable direct redirection to existing converted images?" option. Otherwise the Vary:Accept header will not be added and this can result in problems for users behind proxy servers (ie used in larger companies)
Setting the Operation mode to "No conversion" solved my issue.

CSS not working in Django admin: The resource from [css file url] was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff

Django admin is displaying without CSS because of the error:
The resource from “my-website-address/static/admin/css/responsive.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).
The CSS url I can open in my browser and it looks fine.
What can I do to fix CSS displaying for standard Django admin interface?
I got the error
Refused to apply style from '' because its MIME type
('text/html') is not a supported stylesheet MIME type, and strict MIME
checking is enabled.
because one of my Cloudflare manually created firewall rules blocked CSS URLs.
I discovered this when opened my Cloudflare dashboard and sow that firewall rule was applying 'JS challenge' to the URLs like https://[my-website]/static/admin/css/.
So if your website can not load some resources and you get the error about MIME type please check your Cloudflare dashboard or try to temporary disable it.
in case a google traveler arrives here: in my case the problem was I forgot to call to "collectstatic" after a big django upgrade in production (apache + django 3.2, from 2.2)
Bests, José.-

Manually added WebResource.axd - Any security implications?

I added WebResource.axd (empty file) manually in production environment (IIS7 and Windows Server 2008) after chrome and firefox was giving error 404 for WebResource.axd. And now it is working fine, even with parameters. I am not sure why ASP.NET generating this script in final render result (no problem with VS2008), but now it is working. I want to know, is there any security implications other than what normally associated with WebResource.axd as it is in root directory?
Thanks
I also had this issue recently, after a code change WebResource.axd stopped working for my site. Basically, it exposes dynamic resources over http. For a longer explanation visit:
Just where is webresource.axd?
Typically, what happens is that one of the dynamic resources being requested has failed, but the resource name is encrypted. This blog post will help you decrypt the name, use it and the query string of your failing webresource.axd?___ request to figure out where the error is coming from.
Telerik webresource troubleshooting

Resource interpretted as Script but transferred with MIME type text/html

On our production server(Server 2008 + IIS7) I got the error when loading page
Resource interpretted as Script but transferred with MIME type
text/html: http://[siteurl]telerik.web.ui.webresources.axd
with Sys is not defined as other error.
We are using Telerik Radmenu (not in GAC) and menu does not appear (although we can inspect in chrome to see its loading content).
Also this is working on my local dev machine.
I've searched web and tried few different ideas, like changing the order of http handler for .axd in web.config, matching my local web.config with production, etc.
Would you please guide in right direction?
Cheers.

Resources