mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #22029 from yui-knk/fixup_content_type_regexp
Use sufficient a regexp anchor to check `@response.content_type.to_s`
This commit is contained in:
commit
2828cfd137
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ module ActionDispatch
|
|||
include Rails::Dom::Testing::Assertions
|
||||
|
||||
def html_document
|
||||
@html_document ||= if @response.content_type.to_s =~ /xml$/
|
||||
@html_document ||= if @response.content_type.to_s =~ /xml\z/
|
||||
Nokogiri::XML::Document.parse(@response.body)
|
||||
else
|
||||
Nokogiri::HTML::Document.parse(@response.body)
|
||||
|
|
Loading…
Reference in a new issue