sitehub 0.5.0.alpha3 → 0.5.0.alpha4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/sitehub/collection.rb +1 -1
- data/lib/sitehub/collection/route_collection.rb +1 -1
- data/lib/sitehub/collection/split_route_collection.rb +11 -11
- data/lib/sitehub/identifier.rb +37 -0
- data/lib/sitehub/middleware/route.rb +1 -1
- data/lib/sitehub/middleware/routes.rb +3 -3
- data/lib/sitehub/route_builder.rb +66 -66
- data/lib/sitehub/version.rb +1 -1
- data/spec/sitehub/collection/split_route_collection_spec.rb +18 -2
- data/spec/sitehub/collection_spec.rb +1 -0
- data/spec/sitehub/core_spec.rb +1 -1
- data/spec/sitehub/identifier_spec.rb +89 -0
- data/spec/sitehub/integration_spec.rb +185 -7
- data/spec/sitehub/middleware/routes_spec.rb +14 -8
- data/spec/sitehub/route_builder_spec.rb +142 -153
- data/spec/support/patch/rack/response.rb +1 -1
- metadata +4 -3
- data/spec/support/shared_contexts/sitehub_context.rb +0 -30
@@ -14,7 +14,7 @@ module Rack
|
|
14
14
|
|
15
15
|
def cookie_key_value_array
|
16
16
|
value = header['Set-Cookie'] || ''
|
17
|
-
value.lines.collect { |line| line.scan(%r{([\.\w]+)=([
|
17
|
+
value.lines.collect { |line| Rack::Utils.unescape(line).scan(%r{([\.\w]+)=([\|\.\w/]+)}) }
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitehub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.0.
|
4
|
+
version: 0.5.0.alpha4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ladtech
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -356,6 +356,7 @@ files:
|
|
356
356
|
- lib/sitehub/forward_proxy.rb
|
357
357
|
- lib/sitehub/getter_setter_methods.rb
|
358
358
|
- lib/sitehub/http_headers.rb
|
359
|
+
- lib/sitehub/identifier.rb
|
359
360
|
- lib/sitehub/location_rewriter.rb
|
360
361
|
- lib/sitehub/location_rewriters.rb
|
361
362
|
- lib/sitehub/memoize.rb
|
@@ -400,6 +401,7 @@ files:
|
|
400
401
|
- spec/sitehub/equality_spec.rb
|
401
402
|
- spec/sitehub/forward_proxy_spec.rb
|
402
403
|
- spec/sitehub/http_headers_spec.rb
|
404
|
+
- spec/sitehub/identifier_spec.rb
|
403
405
|
- spec/sitehub/integration_spec.rb
|
404
406
|
- spec/sitehub/location_rewriter_spec.rb
|
405
407
|
- spec/sitehub/location_rewriters_spec.rb
|
@@ -436,7 +438,6 @@ files:
|
|
436
438
|
- spec/support/shared_contexts/module_spec_context.rb
|
437
439
|
- spec/support/shared_contexts/rack_request_context.rb
|
438
440
|
- spec/support/shared_contexts/rack_test_context.rb
|
439
|
-
- spec/support/shared_contexts/sitehub_context.rb
|
440
441
|
- spec/support/shared_examples.rb
|
441
442
|
- spec/support/shared_examples/memoized_helpers.rb
|
442
443
|
- spec/support/shared_examples/prohibited_http_header_filter.rb
|
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'stringio'
|
2
|
-
shared_context :site_hub do
|
3
|
-
let(:downstream_url) { 'http://localhost:12345' }
|
4
|
-
|
5
|
-
before do
|
6
|
-
stub_request(:get, downstream_url).to_return(body: 'hello')
|
7
|
-
end
|
8
|
-
|
9
|
-
let(:builder) do
|
10
|
-
SiteHub::Builder.new.tap do |builder|
|
11
|
-
builder.access_logger StringIO.new
|
12
|
-
builder.error_logger StringIO.new
|
13
|
-
downstream_url = downstream_url()
|
14
|
-
builder.proxy '/endpoint' do
|
15
|
-
split(percentage: 100) do
|
16
|
-
split percentage: 50, label: 'experiment1', url: downstream_url
|
17
|
-
split percentage: 50, label: 'experiment2', url: downstream_url
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
let(:rack_application) do
|
24
|
-
builder.build
|
25
|
-
end
|
26
|
-
|
27
|
-
let :app do
|
28
|
-
rack_application
|
29
|
-
end
|
30
|
-
end
|