<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -179,7 +179,7 @@ module Sinatra
         return unless host === request.host
       end
       if accept = options[:accept]
-        return unless request.accept.include? accept
+        return unless request.accept.include? lookup_mime(accept)
       end
       return unless pattern =~ request.path_info.squeeze('/')
       params.merge!(param_keys.zip($~.captures.map(&amp;:from_param)).to_hash)
@@ -449,8 +449,7 @@ module Sinatra
     #   end
     #
     def content_type(type, params={})
-      type = Rack::File::MIME_TYPES[type.to_s] if type.kind_of?(Symbol)
-      fail &quot;Invalid or undefined media_type: #{type}&quot; if type.nil?
+      type = lookup_mime(type)
       if params.any?
         params = params.collect { |kv| &quot;%s=%s&quot; % kv }.join(', ')
         type = [ type, params ].join(&quot;;&quot;)
@@ -1403,6 +1402,12 @@ def mime(ext, type)
   Rack::File::MIME_TYPES[ext.to_s] = type
 end
 
+def lookup_mime(type)
+  type = Rack::File::MIME_TYPES[type.to_s] if type.kind_of?(Symbol)
+  fail &quot;Invalid or undefined media_type: #{type}&quot; if type.nil?
+  type
+end
+
 ### Misc Core Extensions
 
 module Kernel</diff>
      <filename>lib/sinatra.rb</filename>
    </modified>
    <modified>
      <diff>@@ -217,13 +217,13 @@ context &quot;Events in an app&quot; do
 
   specify &quot;filters by accept header&quot; do
 
-    get '/', :accept =&gt; 'image/jpg' do
+    get '/', :accept =&gt; :xml do
       request.env['HTTP_ACCEPT']
     end
 
-    get_it '/', :env =&gt; { :accept =&gt; 'image/jpg' }
+    get_it '/', :env =&gt; { :accept =&gt; 'application/xml' }
     should.be.ok
-    body.should.equal 'image/jpg'
+    body.should.equal 'application/xml'
 
     get_it '/', :env =&gt; { :accept =&gt; 'text/html' }
     should.not.be.ok</diff>
      <filename>test/application_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>33cbfedbcce13c924e2fbb094e20f24929d38f80</id>
    </parent>
  </parents>
  <author>
    <name>Adam Wiggins</name>
    <email>adam@heroku.com</email>
  </author>
  <url>http://github.com/adamwiggins/sinatra/commit/cfcf7863a865337ea29c764db5a192bf46f50e29</url>
  <id>cfcf7863a865337ea29c764db5a192bf46f50e29</id>
  <committed-date>2008-06-09T00:11:56-07:00</committed-date>
  <authored-date>2008-06-09T00:11:56-07:00</authored-date>
  <message>lookup_mime, used by content_type and accept</message>
  <tree>2969a90c1fb9f573f11ef85a504936f85d9250c5</tree>
  <committer>
    <name>Adam Wiggins</name>
    <email>adam@heroku.com</email>
  </committer>
</commit>
