Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6723725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:36:12+00:00 2026-05-26T09:36:12+00:00

While testing some HTTP server code, I noticed something odd: if I return Content-Type:

  • 0

While testing some HTTP server code, I noticed something odd: if I return Content-Type: text/plain, browsers will not render the content as plain text. Instead, they seem to assume that the server must be misconfigured, and they try to detect the content type instead.

For example, if I return the contents of a PNG file, but with Content-Type: text/plain:

  • FireFox and IE9 both look at the extension on the URL. If it ends in .png, they display it as an image. If not (e.g. if I return the same content from a URL that ends in .xyz), they prompt me to save the file.
  • Chrome and Opera both look at the file’s contents, detect that it’s a PNG, and display it as an image.

Granted, it wouldn’t make sense to return a PNG as text/plain in production; but if I’m testing whether my server is returning the correct Content-Type, the browsers’ second-guessing behavior gets in the way. Plus it’s just kinda goofy, which gets me curious about whether there’s a way to work around it.

Is there a way — with a different Content-Type, or an additional HTTP header, or whatever — that I can tell the browser, “Show this as text, no really, I actually know what I’m doing”?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:36:13+00:00Added an answer on May 26, 2026 at 9:36 am

    See https://datatracker.ietf.org/doc/html/draft-ietf-websec-mime-sniff-03#section-4 for context.

    In some UAs, adding as custom parameter such as

    text/plain; imeanit=yes

    might help.

    Some IE versions support

    X-Content-Type-Options: nosniff

    see http://msdn.microsoft.com/en-us/library/gg622941%28v=vs.85%29.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My time zone is CET (Berlin). And while testing Joda's DateTime i noticed some
I'm having some trouble unit testing a bit of code while utilising the Wcf
I am trying to learn and writting this part of code. while testing few
I get this error, while I'm testing the code below: You have an error
While testing a console app, I set the properties of the console window to
I am getting the NSConcreteData leaked object while testing the leaks in the instruments.It
I'm facing a problem while unit testing my forms. The problem is that data
I've been trying to get started with unit-testing while working on a little cli
While doing performance testing on windows, i usually use perfmon. But when i put
While trying to answer a question in the vicinity ' Unit Testing WPF Bindings

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.