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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03507acb74efe4f9acac94ec797a4e9e2c763e0bea35a64442c2cc5be9a433bd
|
4
|
+
data.tar.gz: d291bf8e88761714b282fb54273dc220615f53ea0d2647a95447c13ff0d3b7c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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&.
|
33
|
-
next HTTParty::Parser.call(body, format || :plain) unless body&.
|
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.
|
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 '
|
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/#{
|
41
|
+
@endpoint ||= "/v1/#{actor}/inbox/replies/#{Base64.encode64(activity).delete("\n")}"
|
42
42
|
end
|
43
43
|
end
|
44
44
|
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.
|
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-
|
11
|
+
date: 2024-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|