Skip to content

Commit

Permalink
set 'Date' header on render of 404 from Webmachine.render_error()
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnny Five committed Apr 8, 2014
1 parent 7b4ecb5 commit a46efc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/webmachine/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def self.render_error(code, req, res, options={})
res.headers['Content-Type'] = "text/html"
end
Webmachine::HeaderNegotiation.ensure_content_length(res)
Webmachine::HeaderNegotiation.ensure_date_header(res)
end


Expand Down
1 change: 1 addition & 0 deletions spec/webmachine/dispatcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ def to_html; "goodbye, cruel world"; end
response.code.should eq(404)
response.body.should_not be_empty
response.headers.should have_key('Content-Length')
response.headers.should have_key('Date')
end
end

0 comments on commit a46efc3

Please sign in to comment.