serverside 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/serverside/http/response.rb +6 -3
- metadata +2 -2
data/Rakefile
CHANGED
@@ -6,7 +6,7 @@ require 'fileutils'
|
|
6
6
|
include FileUtils
|
7
7
|
|
8
8
|
NAME = "serverside"
|
9
|
-
VERS = "0.4.
|
9
|
+
VERS = "0.4.5"
|
10
10
|
CLEAN.include ['**/.*.sw?', 'pkg/*', '.config', 'doc/*', 'coverage/*']
|
11
11
|
RDOC_OPTS = ['--quiet', '--title', "ServerSide: a Fast Ruby Web Framework",
|
12
12
|
"--opname", "index.html",
|
@@ -35,14 +35,17 @@ module ServerSide::HTTP
|
|
35
35
|
end
|
36
36
|
|
37
37
|
ROOT_PATH = '/'.freeze
|
38
|
+
EXPIRATION_FORMAT = "%a, %d-%b-%Y %H:%M:%S GMT".freeze # according to RFC2109 must be GMT
|
38
39
|
|
39
40
|
# Adds a cookie to the response headers.
|
40
41
|
def set_cookie(name, value, opts = {})
|
41
42
|
path = opts[:path] || ROOT_PATH
|
42
|
-
expires = opts[:expires] || (opts[:ttl] && (Time.now + opts[:ttl]))
|
43
|
-
(Time.now + 86400) # if no expiry is specified we assume one day
|
43
|
+
expires = opts[:expires] || (opts[:ttl] && (Time.now + opts[:ttl]))
|
44
44
|
|
45
|
-
v = "#{name}=#{value.to_s.uri_escape}; path=#{path}
|
45
|
+
v = "#{name}=#{value.to_s.uri_escape}; path=#{path}"
|
46
|
+
if expires
|
47
|
+
v << "; expires=#{expires.strftime(EXPIRATION_FORMAT)}"
|
48
|
+
end
|
46
49
|
if domain = opts[:domain]
|
47
50
|
v << "; domain=#{domain}"
|
48
51
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serverside
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-
|
12
|
+
date: 2008-02-05 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|