serverside 0.4.5.3 → 0.4.5.4

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ require 'fileutils'
6
6
  include FileUtils
7
7
 
8
8
  NAME = "serverside"
9
- VERS = "0.4.5.3"
9
+ VERS = "0.4.5.4"
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",
@@ -26,4 +26,8 @@ module ServerSide::HTTP
26
26
  class ForbiddenError < RuntimeError
27
27
  set_http_status STATUS_FORBIDDEN
28
28
  end
29
+
30
+ # This error is raised when a premature content boundary is encountered.
31
+ class PrematureBoundaryError < RuntimeError
32
+ end
29
33
  end
@@ -32,7 +32,7 @@ module ServerSide::HTTP
32
32
  if (@header_count += 1) > MAX_HEADER_COUNT
33
33
  raise BadRequestError, "Too many headers"
34
34
  end
35
-
35
+
36
36
  if line =~ HEADER_RE
37
37
  if $1.size > MAX_HEADER_NAME_SIZE
38
38
  raise BadRequestError, "Invalid header size"
@@ -45,6 +45,8 @@ module ServerSide::HTTP
45
45
  when :cookie: parse_cookies(v)
46
46
  end
47
47
  @headers[k] = v
48
+ # elsif line =~ /^--/
49
+ # raise PrematureBoundaryError
48
50
  else
49
51
  raise BadRequestError, "Invalid header format"
50
52
  end
@@ -125,7 +127,6 @@ module ServerSide::HTTP
125
127
  when CONTENT_DISPOSITION:
126
128
  case v
127
129
  when DISPOSITION_FORM_DATA_RE:
128
- p [$1, $2, $3]
129
130
  part_name = $1.to_sym
130
131
  file_name = $3
131
132
  end
@@ -115,6 +115,10 @@ module ServerSide::HTTP
115
115
  @request.parse_header(line)
116
116
  end
117
117
  end
118
+ # rescue PrematureBoundaryError
119
+ # @in.insert(0, line)
120
+ # expecting_body = @request.content_length.to_i > 0
121
+ # set_state(expecting_body ? :state_request_body : :state_response)
118
122
  end
119
123
 
120
124
  # state_request_body waits for the request body to arrive and then parses
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.5.3
4
+ version: 0.4.5.4
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-08-02 00:00:00 +03:00
12
+ date: 2008-08-03 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency