Skip to content

Commit 38630f6

Browse files
committed
first party changes + version 2.2.0
1 parent bb4387d commit 38630f6

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [2.2.0] - 2020-09-15
9+
### Added
10+
- First Party
11+
812
## [2.1.0] - 2020-09-01
913
### Added
1014
- Added option to set a different px configuration on each request

lib/perimeter_x.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def render_first_party_response(req, px_instance)
135135

136136
if px_config[:first_party_enabled]
137137
# first party enabled - proxy response
138-
fp_response = fp.get_first_party_response(req)
138+
fp_response = fp.send_first_party_request(req)
139139
response.status = fp_response.code
140140
fp_response.to_hash.each do |header_name, header_value_arr|
141141
if header_name!="content-length"
@@ -146,7 +146,7 @@ def render_first_party_response(req, px_instance)
146146
render res_type => fp_response.body
147147
else
148148
# first party disabled - return empty response
149-
response.status = "200"
149+
response.status = 200
150150
res_type = fp.get_response_content_type(req)
151151
render res_type => ""
152152
end

lib/perimeterx/internal/first_party/px_first_party.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(px_config, px_http_client, logger)
1313
]
1414
end
1515

16-
def get_first_party_response(req)
16+
def send_first_party_request(req)
1717
uri = URI.parse(req.original_url)
1818
url_path = uri.path
1919

@@ -114,10 +114,7 @@ def get_first_party_request_type(req)
114114
end
115115

116116
def is_first_party_request(req)
117-
if get_first_party_request_type(req) != -1
118-
return true
119-
end
120-
return false
117+
return get_first_party_request_type(req) != -1
121118
end
122119

123120
def get_response_content_type(req)

lib/perimeterx/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module PxModule
2-
VERSION = '2.1.0'
2+
VERSION = '2.2.0'
33
end

readme.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -357,14 +357,15 @@ To enable first party on your enforcer, add the following routes to your `config
357357
post '/:appid_postfix/xhr/:all', to: 'home#index', constraints: { appid_postfix: /XXXXXXXX/, all:/.*/ }
358358
```
359359

360-
Notice that all occurences of `XXXXXXXX` should be replaced with your px_app_id without the PX prefix. For example: 2H4seK9L
361-
In case you are using more than 1 px_app_id, provide all of them with a `|` sign between them. For example: 2H4seK9L|9bMs6K94|Lc5kPMNx
360+
Notice that all occurences of `XXXXXXXX` should be replaced with your px_app_id without the "PX" prefix. For example, if your px_app_id is `PX2H4seK9L`, reeplace `XXXXXXXX` with `2H4seK9L`.
361+
In case you are using more than one px_app_id, provide all of them with a `|` sign between them. For example: 2H4seK9L|9bMs6K94|Lc5kPMNx
362362

363-
To disable first_party, you can set `first_party_enabled` to false in your configuration.
364-
The default value of this field is true.
363+
364+
First Party configuration:
365+
Default: true
365366

366367
```ruby
367-
params[:first_party_enabled] = false
368+
params[:first_party_enabled] = false
368369
```
369370

370371

0 commit comments

Comments
 (0)