From 3ee98a079ae91c1cf81e6c3d8f704c9625284474 Mon Sep 17 00:00:00 2001 From: Robert Riemann Date: Fri, 13 Apr 2018 17:32:41 +0200 Subject: [PATCH] support the capture of cookies According to https://github.com/lightbody/browsermob-proxy#rest-api , cookies can be captured if enabled. This patch allows to pass over the switch to browsermob-proxy. --- lib/browsermob/proxy/client.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/browsermob/proxy/client.rb b/lib/browsermob/proxy/client.rb index 160880a..326ef1e 100644 --- a/lib/browsermob/proxy/client.rb +++ b/lib/browsermob/proxy/client.rb @@ -34,6 +34,7 @@ def initialize(resource, host, port) # client.new_har("page-name", :capture_headers => true) # client.new_har(:capture_headers => true) # client.new_har(:capture_content => true) + # client.new_har(:capture_cookies => true) # client.new_har(:capture_binary_content => true) # @@ -47,6 +48,7 @@ def new_har(ref = nil, opts = {}) params[:initialPageRef] = ref if ref params[:captureHeaders] = true if opts[:capture_headers] + params[:captureCookies] = true if opts[:capture_cookies] params[:captureContent] = true if opts[:capture_content] if opts[:capture_binary_content]