restrack 1.6.3 → 1.6.4
Sign up to get free protection for your applications and to get access to all the features.
data/lib/restrack/response.rb
CHANGED
@@ -51,6 +51,7 @@ module RESTRack
|
|
51
51
|
when exception.is_a?( HTTP502BadGateway )
|
52
52
|
@status = 502
|
53
53
|
@body = exception.message || 'The server was acting as a gateway or proxy and received an invalid response from the upstream server.'
|
54
|
+
log_server_warning(exception)
|
54
55
|
else # HTTP500ServerError
|
55
56
|
server_error(exception)
|
56
57
|
end # case Exception
|
@@ -70,6 +71,14 @@ module RESTRack
|
|
70
71
|
end
|
71
72
|
|
72
73
|
private
|
74
|
+
def log_server_warning(exception)
|
75
|
+
if @request && @request.request_id
|
76
|
+
RESTRack.log.warn "(#{@request.request_id}) #{exception.class.to_s} " + exception.message + "\n" + exception.backtrace.join("\n")
|
77
|
+
else
|
78
|
+
RESTRack.log.warn "(<nil-reqid>) #{exception.class.to_s} " + exception.message + "\n" + exception.backtrace.join("\n")
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
73
82
|
def log_server_error(exception)
|
74
83
|
if @request && @request.request_id
|
75
84
|
RESTRack.log.error "(#{@request.request_id}) #{exception.class.to_s} " + exception.message + "\n" + exception.backtrace.join("\n")
|
data/lib/restrack/version.rb
CHANGED
@@ -10,6 +10,10 @@ class SampleApp::TestCORSHeaders < Test::Unit::TestCase
|
|
10
10
|
@ws = SampleApp::WebService.new
|
11
11
|
end
|
12
12
|
|
13
|
+
def teardown
|
14
|
+
RESTRack::CONFIG.delete(:CORS)
|
15
|
+
end
|
16
|
+
|
13
17
|
def test_cors_no_origin_header
|
14
18
|
RESTRack::CONFIG[:CORS] = {}
|
15
19
|
RESTRack::CONFIG[:CORS]['Access-Control-Allow-Origin'] = 'http://restrack.me'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restrack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|