Skip to content

Commit

Permalink
Cleanup check for html content type
Browse files Browse the repository at this point in the history
[`Mime::Type.html?`][docs] is a publicly available API that internally
uses a regex.

[docs]: http://api.rubyonrails.org/classes/Mime/Type.html#method-i-html-3F
  • Loading branch information
wireframe authored and seanpdoyle committed May 12, 2017
1 parent 760766c commit bd18720
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
master
------

* Use `Mime::Type.html?`

[#523]: https://github.com/thoughtbot/ember-cli-rails/pull/523

0.8.4
-----

Expand Down
4 changes: 1 addition & 3 deletions lib/ember_cli/ember_constraint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ def rails_info_request?(request)
end

def html_request?(request)
index = request.format.to_s =~ /html/ || -1

index > -1
request.format.html?
end
end
end

0 comments on commit bd18720

Please sign in to comment.