From 6154471b6cecc1834980c223d357c5795fcc6c47 Mon Sep 17 00:00:00 2001 From: bartes Date: Tue, 9 Jul 2024 20:16:57 +0200 Subject: [PATCH] add missing header to specs --- spec/integration/rails/rails_spec.rb | 2 +- spec/lib/castle/client_spec.rb | 3 ++- spec/lib/castle/context/get_default_spec.rb | 3 ++- spec/lib/castle/context/prepare_spec.rb | 3 ++- spec/lib/castle/headers/filter_spec.rb | 3 ++- spec/lib/castle/payload/prepare_spec.rb | 3 ++- 6 files changed, 11 insertions(+), 6 deletions(-) diff --git a/spec/integration/rails/rails_spec.rb b/spec/integration/rails/rails_spec.rb index eae1691c..723b6c1d 100644 --- a/spec/integration/rails/rails_spec.rb +++ b/spec/integration/rails/rails_spec.rb @@ -40,7 +40,7 @@ } end let(:now) { Time.now } - let(:headers) { { 'HTTP_AUTHORIZATION' => 'Basic 123', 'HTTP_X_FORWARDED_FOR' => '5.5.5.5, 1.2.3.4' } } + let(:headers) { { 'HTTP_AUTHORIZATION' => 'Basic 123', 'HTTP_X_FORWARDED_FOR' => '5.5.5.5, 1.2.3.4', 'HTTP_CONTENT_LENGTH' => '0' } } before do Timecop.freeze(now) diff --git a/spec/lib/castle/client_spec.rb b/spec/lib/castle/client_spec.rb index 25a9b70a..0e1bd4a6 100644 --- a/spec/lib/castle/client_spec.rb +++ b/spec/lib/castle/client_spec.rb @@ -9,7 +9,8 @@ '/', 'HTTP_USER_AGENT' => ua, 'HTTP_X_FORWARDED_FOR' => ip, - 'HTTP_COOKIE' => "__cid=#{cookie_id};other=efgh" + 'HTTP_COOKIE' => "__cid=#{cookie_id};other=efgh", + 'HTTP_CONTENT_LENGTH' => '0' ) end let(:request) { Rack::Request.new(env) } diff --git a/spec/lib/castle/context/get_default_spec.rb b/spec/lib/castle/context/get_default_spec.rb index fbf0a10e..4a48ca2d 100644 --- a/spec/lib/castle/context/get_default_spec.rb +++ b/spec/lib/castle/context/get_default_spec.rb @@ -12,7 +12,8 @@ 'HTTP_X_FORWARDED_FOR' => ip, 'HTTP_ACCEPT_LANGUAGE' => 'en', 'HTTP_USER_AGENT' => 'test', - 'HTTP_COOKIE' => "__cid=#{client_id};other=efgh" + 'HTTP_COOKIE' => "__cid=#{client_id};other=efgh", + 'HTTP_CONTENT_LENGTH' => '0' ) end let(:request) { Rack::Request.new(env) } diff --git a/spec/lib/castle/context/prepare_spec.rb b/spec/lib/castle/context/prepare_spec.rb index cc6c87b9..ed08b2f3 100644 --- a/spec/lib/castle/context/prepare_spec.rb +++ b/spec/lib/castle/context/prepare_spec.rb @@ -9,7 +9,8 @@ '/', 'HTTP_USER_AGENT' => ua, 'HTTP_X_FORWARDED_FOR' => ip, - 'HTTP_COOKIE' => "__cid=#{cookie_id};other=efgh" + 'HTTP_COOKIE' => "__cid=#{cookie_id};other=efgh", + 'HTTP_CONTENT_LENGTH' => '0' ) end let(:request) { Rack::Request.new(env) } diff --git a/spec/lib/castle/headers/filter_spec.rb b/spec/lib/castle/headers/filter_spec.rb index 059415bb..729ac6bd 100644 --- a/spec/lib/castle/headers/filter_spec.rb +++ b/spec/lib/castle/headers/filter_spec.rb @@ -14,7 +14,8 @@ 'HTTP_X_FORWARDED_FOR' => '1.2.3.4', 'HTTP_USER_AGENT' => 'Mozilla 1234', 'TEST' => '1', - 'REMOTE_ADDR' => '1.2.3.4' + 'REMOTE_ADDR' => '1.2.3.4', + 'HTTP_CONTENT_LENGTH' => '0' ) result[:HTTP_OK] = 'OK' result diff --git a/spec/lib/castle/payload/prepare_spec.rb b/spec/lib/castle/payload/prepare_spec.rb index f91190ad..ff358e38 100644 --- a/spec/lib/castle/payload/prepare_spec.rb +++ b/spec/lib/castle/payload/prepare_spec.rb @@ -9,7 +9,8 @@ '/', 'HTTP_USER_AGENT' => ua, 'HTTP_X_FORWARDED_FOR' => ip, - 'HTTP_COOKIE' => "__cid=#{cookie_id};other=efgh" + 'HTTP_COOKIE' => "__cid=#{cookie_id};other=efgh", + 'HTTP_CONTENT_LENGTH' => '0' ) end let(:request) { Rack::Request.new(env) }