forest_admin_rpc_agent 1.25.0 → 1.25.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb8d38ba3f13a50a93f9d1a8b409991a9c1d9a1ce426d624a1d1a79392c5284a
|
|
4
|
+
data.tar.gz: f8c9d2e6446988c2b4e3b2a2f83870496db88e2acdefcf1284f7bbfbda48c8d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a4f3b6ead95fa9ab8dd88ed917e0a7e09fa5851d01b3d6028e35bac432ee6af730fef092537e135163b6ec818d9575054365d4c6eb2f0aafb5f7389ae111859a
|
|
7
|
+
data.tar.gz: 26d965d47287818129ce807316ee268209b34d5852f8ba81449531afe4527cf841612d4fee8bff6b6723b2af64cce392299980e0a3aebddaec9107dcd17d444f
|
|
@@ -51,17 +51,6 @@ module ForestAdminRpcAgent
|
|
|
51
51
|
self
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
# Check if provided hash matches the cached schema etag
|
|
55
|
-
def schema_hash_matches?(provided_hash)
|
|
56
|
-
return false unless @cached_schema && @cached_schema[:etag] && provided_hash
|
|
57
|
-
|
|
58
|
-
@cached_schema[:etag] == provided_hash
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def cached_schema_hash
|
|
62
|
-
@cached_schema&.dig(:etag)
|
|
63
|
-
end
|
|
64
|
-
|
|
65
54
|
private
|
|
66
55
|
|
|
67
56
|
def should_skip_schema_update?
|
|
@@ -15,23 +15,20 @@ module ForestAdminRpcAgent
|
|
|
15
15
|
def handle_request(args)
|
|
16
16
|
agent = ForestAdminRpcAgent::Agent.instance
|
|
17
17
|
client_etag = extract_if_none_match(args)
|
|
18
|
-
etag = agent.cached_schema_hash
|
|
19
18
|
|
|
20
|
-
if client_etag && agent.
|
|
19
|
+
if client_etag && client_etag == agent.cached_schema&.dig(:etag)
|
|
21
20
|
ForestAdminRpcAgent::Facades::Container.logger.log(
|
|
22
21
|
'Debug',
|
|
23
22
|
'ETag matches, returning 304 Not Modified'
|
|
24
23
|
)
|
|
25
|
-
return { status: HTTP_NOT_MODIFIED, content: nil
|
|
26
|
-
headers: { 'ETag' => etag } }
|
|
24
|
+
return { status: HTTP_NOT_MODIFIED, content: nil }
|
|
27
25
|
end
|
|
28
26
|
|
|
29
27
|
schema = agent.cached_schema
|
|
30
28
|
|
|
31
29
|
{
|
|
32
30
|
status: HTTP_OK,
|
|
33
|
-
content: schema
|
|
34
|
-
headers: { 'ETag' => etag }
|
|
31
|
+
content: schema
|
|
35
32
|
}
|
|
36
33
|
end
|
|
37
34
|
|