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 938763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:41:30+00:00 2026-05-15T21:41:30+00:00

I want to have Rack serve a specific file with a specific content type.

  • 0

I want to have Rack serve a specific file with a specific content type. It’s a .htc file and it needs to be served as text/x-component so that IE will recognize it. In apache I would just do

AddType text/x-component .htc

How can I achieve this with Rack? Currently the file is served by Rack::Static, but I didn’t find an option to set the content type.

  • 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-15T21:41:30+00:00Added an answer on May 15, 2026 at 9:41 pm

    You can update your config/initializers/mime_types.rb like this:

    # Be sure to restart your server when you modify this file.
    
    # Add new mime types for use in respond_to blocks:
    # Mime::Type.register "text/richtext", :rtf
    # Mime::Type.register_alias "text/html", :iphone
    
    Rack::Mime::MIME_TYPES.merge!({
      ".ogg"     => "application/ogg",
      ".ogx"     => "application/ogg",
      ".ogv"     => "video/ogg",
      ".oga"     => "audio/ogg",
      ".mp4"     => "video/mp4",
      ".m4v"     => "video/mp4",
      ".mp3"     => "audio/mpeg",
      ".m4a"     => "audio/mpeg",
      ".htc"     => "text/x-component"
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a text box that the user can type in that
I want to have a function that will return the reverse of a list
I want to have a select-only ComboBox that provides a list of items for
I want to have a class which implements an interface, which specifies the specific
I use now thin to serve my rack application on my webserver. I have
I have a MVC web application (Ruby, Rack, Apache) and I want it to
I want have a query with a column that is a hardcoded value not
I am currently developing a Rack-based application and want to redirect all file requests
I want have a single database that uses InnoDB tables instead of myISAM tables
I want have a table in my view that is going to put 3

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.