MCPcopy Create free account
hub / github.com/internetarchive/openlibrary / POST

Method POST

openlibrary/plugins/openlibrary/code.py:990–1004  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

988 path = "/system/invalidate"
989
990 def POST(self):
991 global local_ip
992 if local_ip is None:
993 local_ip = socket.gethostbyname(socket.gethostname())
994
995 if web.ctx.ip != "127.0.0.1" and web.ctx.ip.rsplit(".", 1)[0] != local_ip.rsplit(".", 1)[0]:
996 raise Forbidden("Allowed only in the local network.")
997
998 data = json.loads(web.data())
999 if not isinstance(data, list):
1000 data = [data]
1001 for d in data:
1002 thing = client.Thing(web.ctx.site, d["key"], client.storify(d))
1003 client._run_hooks("on_new_version", thing)
1004 return delegate.RawText("ok")
1005
1006
1007def save_error():

Callers

nothing calls this directly

Calls 2

ForbiddenClass · 0.85
loadsMethod · 0.80

Tested by

no test coverage detected