Resource blocked due to MIME type mismatch (X-Content-Type-Options: nosniff)
Check if the file path is correct and the file exists – in my case that was the issue – as I fixed it, the error disappeared
Check if the file path is correct and the file exists – in my case that was the issue – as I fixed it, the error disappeared
You can try adding a @javax.ws.rs.core.Context javax.ws.rs.core.HttpHeaders field/property to your root resource class, resource method parameter, or to a custom javax.ws.rs.ext.ExceptionMapper and calling HttpHeaders.getMediaType().
I realize that this question is old, but for anyone looking for a quick copy/paste for adding font MIME types to their .htaccess: <IfModule mod_mime.c> AddType application/vnd.ms-fontobject .eot AddType application/x-font-opentype .otf AddType image/svg+xml .svg AddType application/x-font-ttf .ttf AddType application/font-woff .woff AddType application/font-woff2 .woff2 </IfModule>
In a multipart e-mail, email.message.Message.get_payload() returns a list with one item for each part. The easiest way is to walk the message and get the payload on each part: import email msg = email.message_from_string(raw_message) for part in msg.walk(): # each part is a either non-multipart, or another multipart message # that contains further parts… Message … Read more
Here’s a small test program that illustrates a difference in the encoded strings: byte[] bytes = new byte[57]; String enc1 = new sun.misc.BASE64Encoder().encode(bytes); String enc2 = new String(java.util.Base64.getMimeEncoder().encode(bytes), StandardCharsets.UTF_8); System.out.println(“enc1 = <” + enc1 + “>”); System.out.println(“enc2 = <” + enc2 + “>”); System.out.println(enc1.equals(enc2)); Its output is: enc1 = <AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA > enc2 = <AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA> false … Read more
According to RFC 1341 (made obsolete by RFC 2045): A Content-Transfer-Encoding header field, which can be used to specify an auxiliary encoding that was applied to the data in order to allow it to pass through mail transport mechanisms which may have data or character set limitations. and later: Many Content-Types which could usefully be … Read more
Office 2007 MIME Types for IIS .docm, application/vnd.ms-word.document.macroEnabled.12 .docx, application/vnd.openxmlformats-officedocument.wordprocessingml.document .dotm, application/vnd.ms-word.template.macroEnabled.12 .dotx, application/vnd.openxmlformats-officedocument.wordprocessingml.template .potm, application/vnd.ms-powerpoint.template.macroEnabled.12 .potx, application/vnd.openxmlformats-officedocument.presentationml.template .ppam, application/vnd.ms-powerpoint.addin.macroEnabled.12 .ppsm, application/vnd.ms-powerpoint.slideshow.macroEnabled.12 .ppsx, application/vnd.openxmlformats-officedocument.presentationml.slideshow .pptm, application/vnd.ms-powerpoint.presentation.macroEnabled.12 .pptx, application/vnd.openxmlformats-officedocument.presentationml.presentation .xlam, application/vnd.ms-excel.addin.macroEnabled.12 .xlsb, application/vnd.ms-excel.sheet.binary.macroEnabled.12 .xlsm, application/vnd.ms-excel.sheet.macroEnabled.12 .xlsx, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xltm, application/vnd.ms-excel.template.macroEnabled.12 .xltx, application/vnd.openxmlformats-officedocument.spreadsheetml.template
It depends what you need the MIME type for. In general, for services (web apps, web service, etc.), it’s advisable not to use a MIME list which is dependent on the OS settings, or only as fallback if you cannot find MIME information otherwise. I think that this is also the reason why MS chose … Read more
Update For a more practical and up-to-date answer, have a look at Palec’s answer. The specified character encoding in Content-Type does only describe the character encoding of the message body but not the header. You need to use the encoded-word syntax with either the quoted-printable encoding or the Base64 encoding: encoded-word = “=?” charset “?” encoding … Read more
Use xdg-utils from freedesktop.org Portland. Register the icon for the MIME type: xdg-icon-resource install –context mimetypes –size 48 myicon-file-type.png x-application-mytype Create a configuration file (freedesktop Shared MIME documentation): <?xml version=”1.0″?> <mime-info xmlns=”http://www.freedesktop.org/standards/shared-mime-info”> <mime-type type=”application/x-mytype”> <comment>A witty comment</comment> <comment xml:lang=”it”>Uno Commento</comment> <glob pattern=”*.myapp”/> </mime-type> </mime-info> Install the configuration file: xdg-mime install mytype-mime.xml This gets your files … Read more