distributed-press-api-client 0.5.0rc7 → 0.5.0rc8

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: bd89dab2da2262332ebc911157a1f85f0da6cc528610c4f9ba4d5e93df55a537
4
- data.tar.gz: c54abf6064037d7c9748d6617dc294f204e338eba929ca7c5fc58408a1e1e25c
3
+ metadata.gz: 03507acb74efe4f9acac94ec797a4e9e2c763e0bea35a64442c2cc5be9a433bd
4
+ data.tar.gz: d291bf8e88761714b282fb54273dc220615f53ea0d2647a95447c13ff0d3b7c1
5
5
  SHA512:
6
- metadata.gz: 5b0d6b4719ce7cdc45182df0382eb09b39851e1fba213b11ab0e3fca8dd63affeebb52a02032d02ad04b504171ef5f4df341b96196bb66a21558beb5c5e7e626
7
- data.tar.gz: f1f7e2abdd76cc2e8bfbc722b6d2525711a5b356e0151d9e1ab142044d329ae91f879fe35ad34fbc389b8b788cc04c0d8659a408a249ff93352856738dbe070b
6
+ metadata.gz: 639668b2192c1e7c256de2d294582e96a1f9c3ddb701ca6102805e7a887265df6a7d73579b97fc5d4dcbe6564b5dbab852e798b22182824cefdf805312dcc17c
7
+ data.tar.gz: 9d54c9a9567c1af53340d9d412a67cf43513c80c2af3642dc843949af0120165cf5a6e7eef8fcef106880e077273157fa84953a25842a735e32e229a617e7c42
@@ -231,7 +231,7 @@ class DistributedPress
231
231
  # after the request is instantiated. No need to process
232
232
  # cookies for now. Uses the public key URL as a caching key so
233
233
  # we revalidate access on shared caches.
234
- options = { body: body, headers: headers, base_uri: url, parser: parser, stream_body: true }
234
+ options = { body: body, headers: headers, base_uri: url, parser: parser, stream_body: true, timeout: 5 }
235
235
  options = HTTParty::ModuleInheritableAttributes.hash_deep_dup(self.class.default_options).merge(options)
236
236
  response_body = ''.dup
237
237
 
@@ -29,8 +29,8 @@ class DistributedPress
29
29
  # @todo Replace with a class
30
30
  @parser =
31
31
  proc do |body, format|
32
- next HTTParty::Parser.call(body, :html) if body&.starts_with? '<'
33
- next HTTParty::Parser.call(body, format || :plain) unless body&.starts_with? '{'
32
+ next HTTParty::Parser.call(body, :html) if body&.start_with? '<'
33
+ next HTTParty::Parser.call(body, format || :plain) unless body&.start_with? '{'
34
34
 
35
35
  object = HTTParty::Parser.call(body, :json)
36
36
 
@@ -43,7 +43,7 @@ class DistributedPress
43
43
 
44
44
  # XXX: format is nil but should be :json
45
45
  @parser = proc do |body, format|
46
- next HTTParty::Parser.call(body, format || :plain) unless body.starts_with? '{'
46
+ next HTTParty::Parser.call(body, format || :plain) unless body.start_with? '{'
47
47
 
48
48
  json = HTTParty::Parser.call(body, :json)
49
49
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'uri'
3
+ require 'base64'
4
4
  require_relative 'client'
5
5
 
6
6
  class DistributedPress
@@ -38,7 +38,7 @@ class DistributedPress
38
38
  #
39
39
  # @return [String]
40
40
  def endpoint
41
- @endpoint ||= "/v1/#{actor}/inbox/replies/#{URI.encode_uri_component(activity)}"
41
+ @endpoint ||= "/v1/#{actor}/inbox/replies/#{Base64.encode64(activity).delete("\n")}"
42
42
  end
43
43
  end
44
44
  end
@@ -3,5 +3,5 @@
3
3
  # API client
4
4
  class DistributedPress
5
5
  # Version
6
- VERSION = '0.5.0rc7'
6
+ VERSION = '0.5.0rc8'
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distributed-press-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0rc7
4
+ version: 0.5.0rc8
5
5
  platform: ruby
6
6
  authors:
7
7
  - f
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-19 00:00:00.000000000 Z
11
+ date: 2024-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable