webrick 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of webrick might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/webrick/httpauth/htdigest.rb +2 -2
- data/lib/webrick/httpauth/htgroup.rb +2 -2
- data/lib/webrick/httpauth/htpasswd.rb +2 -2
- data/lib/webrick/httpservlet/cgi_runner.rb +2 -2
- data/lib/webrick/httpservlet/erbhandler.rb +1 -1
- data/lib/webrick/httpservlet/filehandler.rb +2 -2
- data/lib/webrick/httputils.rb +2 -0
- data/lib/webrick/log.rb +1 -1
- data/lib/webrick/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 679fbeaf42fd0e9df98934eacf8573238f0b32a5bdcab66cb6ded69c3031ca8d
|
4
|
+
data.tar.gz: 77811219317b65fdbc1a3f703d98dc63c9c6d936ef29775cbef7e1aa1f707007
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bce582ecef05a51ae39d331f6cf2a3a1f35bd5bde35ea69be01374ec9dc851a536fbb37ea276d37f137d86d8af2258b0caf34b30dce83f3a79d36e88b2cfefc
|
7
|
+
data.tar.gz: 1c4fa49ececffec80b3d3ab8013960379d157202ba4b81959d6bcd91f0dcc978fcc55d60628d2383b8b80c7d1c4ce6b4dc5ca067ea548d0e20ce643d3cb26067
|
@@ -40,7 +40,7 @@ module WEBrick
|
|
40
40
|
@digest = Hash.new
|
41
41
|
@mutex = Thread::Mutex::new
|
42
42
|
@auth_type = DigestAuth
|
43
|
-
open(@path,"a").close unless File
|
43
|
+
File.open(@path,"a").close unless File.exist?(@path)
|
44
44
|
reload
|
45
45
|
end
|
46
46
|
|
@@ -51,7 +51,7 @@ module WEBrick
|
|
51
51
|
mtime = File::mtime(@path)
|
52
52
|
if mtime > @mtime
|
53
53
|
@digest.clear
|
54
|
-
open(@path){|io|
|
54
|
+
File.open(@path){|io|
|
55
55
|
while line = io.gets
|
56
56
|
line.chomp!
|
57
57
|
user, realm, pass = line.split(/:/, 3)
|
@@ -36,7 +36,7 @@ module WEBrick
|
|
36
36
|
@path = path
|
37
37
|
@mtime = Time.at(0)
|
38
38
|
@group = Hash.new
|
39
|
-
open(@path,"a").close unless File
|
39
|
+
File.open(@path,"a").close unless File.exist?(@path)
|
40
40
|
reload
|
41
41
|
end
|
42
42
|
|
@@ -46,7 +46,7 @@ module WEBrick
|
|
46
46
|
def reload
|
47
47
|
if (mtime = File::mtime(@path)) > @mtime
|
48
48
|
@group.clear
|
49
|
-
open(@path){|io|
|
49
|
+
File.open(@path){|io|
|
50
50
|
while line = io.gets
|
51
51
|
line.chomp!
|
52
52
|
group, members = line.split(/:\s*/)
|
@@ -40,7 +40,7 @@ module WEBrick
|
|
40
40
|
@mtime = Time.at(0)
|
41
41
|
@passwd = Hash.new
|
42
42
|
@auth_type = BasicAuth
|
43
|
-
open(@path,"a").close unless File
|
43
|
+
File.open(@path,"a").close unless File.exist?(@path)
|
44
44
|
reload
|
45
45
|
end
|
46
46
|
|
@@ -51,7 +51,7 @@ module WEBrick
|
|
51
51
|
mtime = File::mtime(@path)
|
52
52
|
if mtime > @mtime
|
53
53
|
@passwd.clear
|
54
|
-
open(@path){|io|
|
54
|
+
File.open(@path){|io|
|
55
55
|
while line = io.gets
|
56
56
|
line.chomp!
|
57
57
|
case line
|
@@ -23,11 +23,11 @@ STDIN.binmode
|
|
23
23
|
|
24
24
|
len = sysread(STDIN, 8).to_i
|
25
25
|
out = sysread(STDIN, len)
|
26
|
-
STDOUT.reopen(open(out, "w"))
|
26
|
+
STDOUT.reopen(File.open(out, "w"))
|
27
27
|
|
28
28
|
len = sysread(STDIN, 8).to_i
|
29
29
|
err = sysread(STDIN, len)
|
30
|
-
STDERR.reopen(open(err, "w"))
|
30
|
+
STDERR.reopen(File.open(err, "w"))
|
31
31
|
|
32
32
|
len = sysread(STDIN, 8).to_i
|
33
33
|
dump = sysread(STDIN, len)
|
@@ -53,7 +53,7 @@ module WEBrick
|
|
53
53
|
raise HTTPStatus::Forbidden, "ERBHandler cannot work."
|
54
54
|
end
|
55
55
|
begin
|
56
|
-
data = open(@script_filename
|
56
|
+
data = File.open(@script_filename, &:read)
|
57
57
|
res.body = evaluate(ERB.new(data), req, res)
|
58
58
|
res['content-type'] ||=
|
59
59
|
HTTPUtils::mime_type(@script_filename, @config[:MimeTypes])
|
@@ -57,7 +57,7 @@ module WEBrick
|
|
57
57
|
res['content-type'] = mtype
|
58
58
|
res['content-length'] = st.size
|
59
59
|
res['last-modified'] = mtime.httpdate
|
60
|
-
res.body = open(@local_path, "rb")
|
60
|
+
res.body = File.open(@local_path, "rb")
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -92,7 +92,7 @@ module WEBrick
|
|
92
92
|
raise HTTPStatus::BadRequest,
|
93
93
|
"Unrecognized range-spec: \"#{req['range']}\""
|
94
94
|
end
|
95
|
-
open(filename, "rb"){|io|
|
95
|
+
File.open(filename, "rb"){|io|
|
96
96
|
if ranges.size > 1
|
97
97
|
time = Time.now
|
98
98
|
boundary = "#{time.sec}_#{time.usec}_#{Process::pid}"
|
data/lib/webrick/httputils.rb
CHANGED
@@ -108,6 +108,8 @@ module WEBrick
|
|
108
108
|
# Loads Apache-compatible mime.types in +file+.
|
109
109
|
|
110
110
|
def load_mime_types(file)
|
111
|
+
# note: +file+ may be a "| command" for now; some people may
|
112
|
+
# rely on this, but currently we do not use this method by default.
|
111
113
|
open(file){ |io|
|
112
114
|
hash = Hash.new
|
113
115
|
io.each{ |line|
|
data/lib/webrick/log.rb
CHANGED
data/lib/webrick/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webrick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TAKAHASHI Masayoshi
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-12-
|
13
|
+
date: 2017-12-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rake
|