angelo 0.1.21 → 0.1.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/angelo/server.rb +3 -0
- data/lib/angelo/version.rb +1 -1
- data/lib/angelo.rb +2 -3
- data/test/angelo_spec.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e0c3ba39f8e1f28399b3302508e5607e184306c
|
4
|
+
data.tar.gz: 80a96668a3b52d38d10128f849115f5a9ffc639c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8692b30501f977877aca3f79246f66dcf046e9d40100577ff79afe8235e5212081c6cda1545e9dc8a78272cc1a98e9a16ce436891bc2735713f4aaac1227b068
|
7
|
+
data.tar.gz: 1a0a3c79e9bb12a5c49bc3af8913c4099c7b281dbd429ba2fcdbc9f32c5a606b4fcf21fd5925d25d6a678b783fcaa2152c71251c77141556553510e0bbea1430
|
data/CHANGELOG.md
CHANGED
data/lib/angelo/server.rb
CHANGED
@@ -41,6 +41,9 @@ module Angelo
|
|
41
41
|
else
|
42
42
|
route! meth, connection, request
|
43
43
|
end
|
44
|
+
rescue URI::InvalidURIError => e
|
45
|
+
Angelo.log connection, request, nil, :bad_request
|
46
|
+
connection.respond :bad_request, DEFAULT_RESPONSE_HEADERS, e.message
|
44
47
|
end
|
45
48
|
|
46
49
|
def route! meth, connection, request
|
data/lib/angelo/version.rb
CHANGED
data/lib/angelo.rb
CHANGED
@@ -48,7 +48,7 @@ module Angelo
|
|
48
48
|
|
49
49
|
NOT_FOUND = 'Not Found'
|
50
50
|
|
51
|
-
LOG_FORMAT = '%s - - "%s %s
|
51
|
+
LOG_FORMAT = '%s - - "%s %s HTTP/%s" %d %s'
|
52
52
|
|
53
53
|
DEFAULT_PING_TIME = 30
|
54
54
|
|
@@ -84,8 +84,7 @@ module Angelo
|
|
84
84
|
Celluloid::Logger.__send__ Angelo.response_log_level, LOG_FORMAT % [
|
85
85
|
remote_ip[],
|
86
86
|
request.method,
|
87
|
-
request.
|
88
|
-
request.query_string.nil? ? nil : '?'+request.query_string,
|
87
|
+
request.url,
|
89
88
|
request.version,
|
90
89
|
Symbol === status ? HTTP::Response::SYMBOL_TO_STATUS_CODE[status] : status,
|
91
90
|
body_size
|
data/test/angelo_spec.rb
CHANGED
@@ -97,6 +97,15 @@ describe Angelo::Base do
|
|
97
97
|
r.status.must_equal 404
|
98
98
|
end
|
99
99
|
|
100
|
+
it 'does not crash when receiving invalid uri' do
|
101
|
+
s = TCPSocket.new Angelo::DEFAULT_ADDR, Angelo::DEFAULT_PORT
|
102
|
+
s.write 'GET /?file=<SCRIPT>window.alert</SCRIPT>' + "\n\n"
|
103
|
+
r = s.read
|
104
|
+
s.close
|
105
|
+
assert @server.alive?
|
106
|
+
r.must_match /400 Bad Request/
|
107
|
+
end
|
108
|
+
|
100
109
|
end
|
101
110
|
|
102
111
|
describe 'before filter' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angelo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kenichi Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: reel
|