activitypub 0.5.2 → 0.5.3

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: e338ac7d0c5af88a4737eb2b6eaecbd528769917a08676d734f0878b5ed6b1ef
4
- data.tar.gz: 691352bc4144612c077ad07cc846ab4914c93405588c615542d18ccf4acd9c02
3
+ metadata.gz: c79db959b5ea6174f498559a8e668e1a2428f2cf494733a73aea82b1a4408f5f
4
+ data.tar.gz: d07463295371863d4edbe55713e63614e078f578769d7527aebad5da11ee3fd8
5
5
  SHA512:
6
- metadata.gz: 1e0b8f96fda04e91edbd1b3c16a5510547b57f1790072fe97d1aae88a03cbc66061196f64b3c16927e969e07d00e001a4a76d5f39be81b57ae09ed5053a34c3b
7
- data.tar.gz: bceecaf4662e651e702c027b369b28de0178da5ee07a899c2fd746a940b69b8986a37b6dea8c70b5428c5038f98916336a9b2a11f0b58426db4c3e3210113fae
6
+ metadata.gz: bd2f0229349ca5ab4a0f0a473b930f5a23e513484c6d0c063ee232495c3a1f30d85698c862f6044079f7e276b4b7f767a59a741c442da53bff2c639560c1e0e2
7
+ data.tar.gz: 9115b93cf7404621eca8056c087b3290a1a00aff3e48ef567ea12e5eb8d8ce0caa6ddd35c7bbd590118f0cfeeff88c6611679e8fa96d32cbb2ace4d69c4046fd
@@ -2,6 +2,7 @@
2
2
  require 'uri'
3
3
  require 'faraday'
4
4
  require 'socket'
5
+ require 'ipaddr'
5
6
 
6
7
  # Classes to resolve URI's into objects.
7
8
 
@@ -12,7 +13,8 @@ module ActivityPub
12
13
  def self.call(path)
13
14
 
14
15
  uri = URI(path)
15
- if uri.host == "localhost" || ((IPSocket.getaddress(uri.host) =~ /127.*/) == 0)
16
+ addr = IPAddr.new(IPSocket.getaddress(uri.host))
17
+ if addr.loopback? || addr.private? || addr.link_local?
16
18
  raise "Local access denied"
17
19
  end
18
20
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActivityPub
4
- VERSION = "0.5.2"
4
+ VERSION = "0.5.3"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activitypub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vidar Hokstad
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-22 00:00:00.000000000 Z
11
+ date: 2024-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webfinger