2022 Developer Survey is open! Take survey.

Questions tagged [content-type]

Content-Type is an HTTP header that tells the client the type of content that is being served. Browsers will do MIME sniffing in some cases, and will not necessarily follow the value of this header; to prevent this behavior, the header X-Content-Type-Options can be set to nosniff.

Filter by
Sorted by
Tagged with
1 vote
1 answer
110 views

Configure nginx to set the content type from the URL only when there is an allowed user

I implemented a location configuration like this (legituser is set by a map lookup): location / { if ($legituser = 0) { return 200 "you are not allowed to access this url, please do bla bla ...
user avatar
  • 133
1 vote
1 answer
143 views

Apache serves .svg file without Content-type header

Apache is serving an .svg file, but the HTTP response does not have a Content-type header. Consequently, Chrome is displaying the text of the .svg file, rather than the desired image. My goal is for ...
user avatar
  • 111
2 votes
0 answers
43 views

.mht files display as junk text from Jetty server

I have some .mht files which load fine from local files but when loaded from the Jetty web server display as junk text. What can I do to make them work correctly from my Jetty web server? I know ...
user avatar
  • 29
4 votes
0 answers
104 views

Responding other 'Content-Type' different from 'Accept' list

As all you know (else follow this question) the requesting Accept header allows client to specify the expected MIME types for response content. But my case is: client indicates an Accept of type ...
user avatar
  • 141
1 vote
0 answers
201 views

How can I make my socket.id/nodejs server serve CSS files with the correct mime-type?

I'm using socket.io and https://socket.io/get-started/chat/ to produce a very basic chat server on a remote desktop running Debian. When I access the server's "main" page on port 3000, it fails to ...
user avatar
  • 11
3 votes
1 answer
4k views

Nginx: set Content-Type by URI problem

I'm setting up small personal file hosting, I made a backend to store uploaded files by their hash directly on the HDD like /f/ab/cd/ef012345678..., but without file extensions and generate an URI ...
user avatar
  • 133
4 votes
1 answer
258 views

Does Google search prefer PDF files over HTML files in its search results?

I have noticed for some time, that when I search for something using Google search, I gets lots of hits that are all PDF links. (I know I can tell it not to find PDF hits using -filetype:pdf) But the ...
user avatar
  • 141
1 vote
1 answer
205 views

In httpd.conf why would you want AddType for phps?

We have an AddType as follows: AddType application/x-httpd-php-source .phps I was wondering what this was, and did some searching. It seems this is barely documented anywhere. Based on a hunch, I ...
user avatar
4 votes
2 answers
947 views

How to configure MediaWiki to allow uploading text/plain ".conf' files

I'm having a heck of a time getting our internal MediaWiki to allow CONF file uploads. A CONF file is just a plain text file with a *.conf extension. In ...\LocalSettings.php, I added txt and conf to ...
user avatar
1 vote
1 answer
167 views

Fixing french language characters - some OK some not

I need to fix some pages on a friend website somebody did for him. It is a french-speaking website. Here is the code of the page showing all OK characters, ...followed by the code of a non-OK showing ...
user avatar
  • 45
0 votes
1 answer
320 views

Webpage loading with wrong content-type after setting up CloudFlare

I recently migrated my blog to the Ghost service, I've also setup an alias DNS record with CloudFlare. While showing the blog to a colleague I discovered one of the posts wasn't loading properly and ...
user avatar
1 vote
1 answer
324 views

Does image mime-type affect SEO?

I have uploaded images as mime-type application/octet-stream. They are served well if sourced from an image tag but Chrome for example cannot open them directly, always asks for download. The ...
user avatar
  • 215
136 votes
5 answers
211k views

Difference between the Accept and Content-Type HTTP headers

So the Accept header tells the server the MIME-type of the resource the browser is looking for. For example, the server can send plain text, HTML, JSON, etc. OK, that makes sense, but when I look at ...
user avatar
  • 1,503