feat(rpc): add ETag header with md5 hash content

The ETag header can be used for client-side caching.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-10-29 23:10:20 -07:00
parent b3b31394e8
commit 6d376fed15
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 33 additions and 6 deletions

View file

@ -99,8 +99,7 @@ class RPC:
data: Dict[str, Any]):
# Walk through all related PackageDependencies and produce
# the appropriate dict entries.
depends = package.package_dependencies
for dep in depends:
for dep in package.package_dependencies:
if dep.DepTypeID in DEP_TYPES:
key = DEP_TYPES.get(dep.DepTypeID)
@ -114,8 +113,7 @@ class RPC:
data: Dict[str, Any]):
# Walk through all related PackageRelations and produce
# the appropriate dict entries.
relations = package.package_relations
for rel in relations:
for rel in package.package_relations:
if rel.RelTypeID in REL_TYPES:
key = REL_TYPES.get(rel.RelTypeID)