otto 1.1.0.pre.alpha3 → 1.1.0.pre.alpha4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 997700f94e7e19bd44e84fac3c0be5a5f365d65a4ddabe10562a1eda6ff71126
4
- data.tar.gz: d145bb6c45e446749085a0ee19db585a0ecbf34fc1db4210cc9ec3fd20f99791
3
+ metadata.gz: e1ad2b9c043b3b58202eadcae63354ebead1b70178fd7723dc24820462a3831a
4
+ data.tar.gz: f95e243be8e6e59c5a17f7ec98d7a05d1a31599e0970e9e20763c569a65acfb8
5
5
  SHA512:
6
- metadata.gz: e4f16779b2524caca798ce35b4de0acaaa7977669b7841371a7a7a5cc9cf6e35ab078693a2fd32dcf3a3da929de7767d7f04f3636146870480f71dd388278cb1
7
- data.tar.gz: 7594592074c105359de7cd4672b64e0ce09dac836036725bed35ea29e3ff6f941caf32cad05d3731485c56c62a0fc291214a36903fe2a9f9b03fc96d19ebbb1e
6
+ metadata.gz: 4ed91d559e7e339df4c5a28be0864ff2151e3e06e9dea577dedb346eaf4476e0d62adc84de508d3ff1ea1c55633789643b5f5bcee15d88bd6c8a43c6b7f04a59
7
+ data.tar.gz: 7d5f8bfb03f7e9ce91eebf632df7cc5ccf8b804beac9777662ef490507d1dba3a3ed1401d9e498ecb749617b8ab561a73c2226cb66c02f4796e18148b6afa479
data/Gemfile.lock CHANGED
@@ -1,8 +1,16 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ otto (1.1.0.pre.alpha3)
5
+ addressable (~> 2.2, < 3)
6
+ rack (~> 2.2, < 3.0)
7
+ rexml (>= 3.3.6)
8
+
1
9
  GEM
2
10
  remote: https://rubygems.org/
3
11
  specs:
4
- addressable (2.8.6)
5
- public_suffix (>= 2.0.2, < 6.0)
12
+ addressable (2.8.7)
13
+ public_suffix (>= 2.0.2, < 7.0)
6
14
  ast (2.4.2)
7
15
  byebug (11.1.3)
8
16
  coderay (1.1.3)
@@ -20,12 +28,12 @@ GEM
20
28
  pry-byebug (3.10.1)
21
29
  byebug (~> 11.0)
22
30
  pry (>= 0.13, < 0.15)
23
- public_suffix (5.0.5)
31
+ public_suffix (6.0.1)
24
32
  racc (1.7.3)
25
- rack (3.0.10)
33
+ rack (2.2.9)
26
34
  rainbow (3.1.1)
27
35
  regexp_parser (2.9.0)
28
- rexml (3.2.6)
36
+ rexml (3.3.7)
29
37
  rubocop (1.62.1)
30
38
  json (~> 2.3)
31
39
  language_server-protocol (>= 3.17.0)
@@ -53,14 +61,10 @@ PLATFORMS
53
61
  ruby
54
62
 
55
63
  DEPENDENCIES
56
- addressable
64
+ otto!
57
65
  pry-byebug
58
- rack
59
66
  rubocop
60
67
  tryouts
61
68
 
62
- RUBY VERSION
63
- ruby 3.2.0p0
64
-
65
69
  BUNDLED WITH
66
70
  2.5.7
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  :MAJOR: 1
2
2
  :MINOR: 1
3
3
  :PATCH: 0
4
- :PRE: alpha3
4
+ :PRE: alpha4
data/lib/otto/route.rb CHANGED
@@ -47,7 +47,7 @@ class Otto
47
47
  req.params.replace Otto::Static.indifferent_params(req.params)
48
48
  klass.extend Otto::Route::ClassMethods
49
49
  klass.otto = self.otto
50
- Otto.logger.debug "Route class: #{klass}"
50
+
51
51
  case kind
52
52
  when :instance
53
53
  inst = klass.new req, res
data/lib/otto.rb CHANGED
@@ -92,7 +92,23 @@ class Otto
92
92
  end
93
93
  path_info = Rack::Utils.unescape(env['PATH_INFO'])
94
94
  path_info = '/' if path_info.to_s.empty?
95
- path_info_clean = path_info.gsub /\/$/, ''
95
+
96
+ begin
97
+ path_info_clean = path_info
98
+ .encode(
99
+ 'UTF-8', # Target encoding
100
+ invalid: :replace, # Replace invalid byte sequences
101
+ undef: :replace, # Replace characters undefined in UTF-8
102
+ replace: '' # Use empty string for replacement
103
+ )
104
+ .gsub(/\/$/, '') # Remove trailing slash, if present
105
+ rescue ArgumentError => ex
106
+ # Log the error
107
+ Otto.logger.error "[Otto.call] Error cleaning `#{path_info}`: #{ex.message}"
108
+ # Set a default value or use the original path_info
109
+ path_info_clean = path_info
110
+ end
111
+
96
112
  base_path = File.split(path_info).first
97
113
  # Files in the root directory can refer to themselves
98
114
  base_path = path_info if base_path == '/'
data/otto.gemspec CHANGED
@@ -19,6 +19,9 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.required_ruby_version = ['>= 2.6.8', '< 4.0']
21
21
 
22
+ # https://github.com/delano/otto/security/dependabot/5
23
+ spec.add_dependency 'rexml', '>= 3.3.6'
24
+
22
25
  spec.add_runtime_dependency 'addressable', '~> 2.2', '< 3'
23
26
  spec.add_runtime_dependency 'rack', '~> 2.2', '< 3.0'
24
27
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: otto
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.pre.alpha3
4
+ version: 1.1.0.pre.alpha4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Delano Mandelbaum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-28 00:00:00.000000000 Z
11
+ date: 2024-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rexml
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 3.3.6
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.3.6
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: addressable
15
29
  requirement: !ruby/object:Gem::Requirement