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

Function startswithtest

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

Source from the content-addressed store, hash-verified

121
122@app.route("/startswith/<engine>")
123def startswithtest(engine):
124 template = request.values.get('tpl')
125 if not template:
126 template = '%s'
127
128 str_startswith = request.values.get('startswith')
129
130 injection = request.values.get('inj', '')
131 if not injection.startswith(str_startswith):
132 return 'Missing startswith'
133
134 if engine == 'mako':
135 return randomword() + MakoTemplates(template % injection, lookup=mylookup).render() + randomword()
136 elif engine == 'jinja2':
137 return randomword() + Jinja2Env.from_string(template % injection).render() + randomword()
138
139
140@app.route("/blind/<engine>")

Callers

nothing calls this directly

Calls 3

randomwordFunction · 0.85
getMethod · 0.80
renderMethod · 0.80

Tested by

no test coverage detected