MCPcopy Create free account
hub / github.com/OWASP/Python-Honeypot / get_file

Function get_file

api/server.py:68–82  ·  view source on GitHub ↗

open the requested file in HTTP requests Args: filename: path and the filename Returns: content of the file or abort(404)

(filename)

Source from the content-addressed store, hash-verified

66
67
68def get_file(filename):
69 """
70 open the requested file in HTTP requests
71
72 Args:
73 filename: path and the filename
74
75 Returns:
76 content of the file or abort(404)
77 """
78 try:
79 src = os.path.join(root_dir(), filename)
80 return open(src, 'rb').read()
81 except IOError:
82 abort(404)
83
84
85def get_value_from_request(_key):

Callers 1

get_static_filesFunction · 0.85

Calls 1

root_dirFunction · 0.90

Tested by

no test coverage detected