whoamid 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/whoamid/server.rb +12 -0
- data/lib/whoamid/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca3638613b03b9fb43d794001829f48822673b2e8d42f78d0437c7e29d67ff9e
|
4
|
+
data.tar.gz: bfefcb3be58685ef8143d1f441afb12859310ea78db412ec6f00f232eb953620
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4586dc768ce38376e7398acea13ca8e973b31bcab97b02e883db50c39d56977c3c18ad43edb250c386e21f26d2ee581fa89a45034530933d18ff7949fab75487
|
7
|
+
data.tar.gz: 00e8302fb45dca5672fbe3de7168a32f227ee53569f714a9ee4f5dc76c9ba9c074bd55af5aaf04b0b6fab57783b4d697f42da58b7e4eb4afa31b2d91877fae1b
|
data/Gemfile.lock
CHANGED
data/lib/whoamid/server.rb
CHANGED
@@ -23,6 +23,18 @@ module Whoamid
|
|
23
23
|
res.body = ENV["HOSTNAME"]
|
24
24
|
end
|
25
25
|
|
26
|
+
server.mount_proc '/echo' do |req,res|
|
27
|
+
response = []
|
28
|
+
response << "remote ip: #{req.remote_ip}"
|
29
|
+
|
30
|
+
response << "headers"
|
31
|
+
req.each do |header|
|
32
|
+
response << "#{header}: #{req[header]}"
|
33
|
+
end
|
34
|
+
response << ""
|
35
|
+
res.body = response.join("\n")
|
36
|
+
end
|
37
|
+
|
26
38
|
server.start
|
27
39
|
end
|
28
40
|
end
|
data/lib/whoamid/version.rb
CHANGED