low_loop 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abe38442f905fd127290f9a3720dea3fedd6c472499c8b3117d872d39ccbdb63
4
- data.tar.gz: b7cc6eaf3b18760c48ccf745d83cb65845af373a8bb7645a703bf02f4944655f
3
+ metadata.gz: 46278df08960f6243c32f11afb3ddcb30af1d7711aff896eb6119db918c6405b
4
+ data.tar.gz: c37e341b7c0fcdb779c7ec2f0b7a58425235f1ccabe7e408abb30c69cf461690
5
5
  SHA512:
6
- metadata.gz: 0add75ff01e10dce385277d7e74fbccf6ace5b0f215273e7cac0944ed9201a14fcda73865b56f821b30a361d668bf2092ac5ab261291a367d16f9c7c3dca8e36
7
- data.tar.gz: bd98bcc28d8b08c1501fa1bc44fb1a0834506f49b4c3726bde43b82852622f5108850f7ca3bd68a0937b865e1f58fbf92d40fb23103ac8d75d025587d7d061b4
6
+ metadata.gz: d969993af0a105cddfdc438511b6497bacc366a73809e7aa6b7def338b63f1921deadddcae103d61d2c3d9341fd68a0813be3c8b92c5925abc2b5c0692897b2c
7
+ data.tar.gz: 7324e92a8631a473288dbd5e9e87720d8089484c6bbe456efb9a4818fa4a67b4a658a16e538d214ed1bd19364204e7645ed2e621c937ea90b85aace7bded2c2f
@@ -29,21 +29,14 @@ module Low
29
29
 
30
30
  # TODO: Define type: Events::RequestEvent
31
31
  def handle(event:)
32
- filepath = Protocol::URL::Path.to_local_path(Protocol::URL[event.request.path].path)
32
+ filepath = Protocol::URL[event.request.path].local_path(@web_root)
33
33
 
34
34
  extension = extension(filepath:)
35
35
  return nil if extension.nil?
36
36
 
37
- file = States::FileState.new(path: safe_path(filepath), content_type: @content_types[extension])
37
+ file = States::FileState.new(path: filepath, content_type: @content_types[extension])
38
38
 
39
39
  Events::FileEvent.trigger(file:, request: event.request)
40
40
  end
41
-
42
- private
43
-
44
- def safe_path(path)
45
- safe_path = path.split('/').reject { |segment| ['.', '..'].include?(segment) }.join('/')
46
- File.join(@web_root, safe_path)
47
- end
48
41
  end
49
42
  end
data/lib/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Low
4
4
  module Loop
5
- VERSION = '0.7.1'
5
+ VERSION = '0.7.2'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: low_loop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - maedi