MCPcopy
hub / github.com/epinna/tplmap / headerfunc

Function headerfunc

tests/env_py_tests/webserver.py:79–90  ·  view source on GitHub ↗
(engine)

Source from the content-addressed store, hash-verified

77
78@app.route("/header/<engine>")
79def headerfunc(engine):
80
81 template = request.headers.get('tpl')
82 if not template:
83 template = '%s'
84
85 injection = request.headers.get('User-Agent')
86
87 if engine == 'mako':
88 return randomword() + MakoTemplates(template % injection, lookup=mylookup).render() + randomword()
89 elif engine == 'jinja2':
90 return randomword() + Jinja2Env.from_string(template % injection).render() + randomword()
91
92@app.route("/put/<engine>", methods = [ "PUT" ])
93def putfunc(engine):

Callers

nothing calls this directly

Calls 3

randomwordFunction · 0.85
getMethod · 0.80
renderMethod · 0.80

Tested by

no test coverage detected