Skip to content

Commit

Permalink
Record the User-Agent header
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary committed Jul 12, 2010
1 parent c487f59 commit 4109014
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/mongo_metrics/request_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def record_env
document["request_method"] = request.request_method
document["url_scheme"] = request.scheme
document["path"] = request.path
document["user_agent"] = request.user_agent
record_cookies
end

Expand Down
8 changes: 6 additions & 2 deletions spec/mongo_metrics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@
request_document["cookies"].should == { "foo" => "bar", "baz" => "bop" }
end

# TODO:
it "records the user agent header by default"
it "records the user agent header" do
header "User-Agent", "Chrome"
get "/"
request_document["user_agent"].should == "Chrome"
end

it "records specified request HTTP headers"
it "records the response content type"
it "records specified session values"
Expand Down

0 comments on commit 4109014

Please sign in to comment.