Skip to content Skip to sidebar Skip to footer

Refused To Apply Style Because Mime Type Is Not Supported

I keep getting an error that says that the MIME type ('text/html') isn't executable or not a supported stylesheet MIME type and that strict MIME checking is enabled. My code that

Solution 1:

I imagine you'd want text/css for your stylesheets, and application/javascript for the JS files.

According to the sinatra docs, the incoming request object can be accessed from the request level

get '/foo'do
  t = %w[text/css text/html application/javascript]
  request.accept              # ['text/html', '*/*']
  request.accept? 'text/xml'# true
  request.preferred_type(t)   # 'text/html'
end

Post a Comment for "Refused To Apply Style Because Mime Type Is Not Supported"