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

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 ...
Marged's user avatar
  • 143
1 vote
1 answer

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 ...
mpb's user avatar
  • 111
2 votes
0 answers

.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 ...
krish's user avatar
  • 29
4 votes
0 answers

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 ...
lucasvc's user avatar
  • 141
1 vote
0 answers

How can I make my server serve CSS files with the correct mime-type?

I'm using and 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 ...
Matt's user avatar
  • 11
3 votes
1 answer

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 ...
Eirenliel's user avatar
  • 133
4 votes
1 answer

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 ...
Nasser's user avatar
  • 141
1 vote
1 answer

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 ...
Jeffrey Simon's user avatar
4 votes
2 answers

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

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 ...
revv86's user avatar
  • 45
0 votes
1 answer

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 ...
Daniel Little's user avatar
1 vote
1 answer

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 ...
Ayyash's user avatar
  • 215
142 votes
5 answers

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 ...
JohnMerlino's user avatar
  • 1,563