Exclude method from json parse in before
This commit is contained in:
@@ -37,9 +37,11 @@ before do
|
||||
'Access-Control-Expose-Headers' => 'X-Total-Count',
|
||||
'Access-Control-Allow-Credentials' => 'true'
|
||||
|
||||
request.body.rewind
|
||||
json_string = request.body.read
|
||||
@json_params = JSON.parse json_string if json_string.length > 1
|
||||
unless Helper::do_not_parse_as_json.include? env['PATH_INFO']
|
||||
request.body.rewind
|
||||
json_string = request.body.reads
|
||||
@json_params = JSON.parse json_string if json_string.length > 1
|
||||
end
|
||||
|
||||
if request.request_method == 'OPTIONS'
|
||||
halt 200
|
||||
|
||||
@@ -10,4 +10,8 @@ class Helper
|
||||
def self.bam_to_euro(amount)
|
||||
self.get_bam_to_euro_conversion_rate * amount
|
||||
end
|
||||
|
||||
def self.do_not_parse_as_json
|
||||
['/payment/confirmation']
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user