- Rename functions, variables, parameters and imports with scope-aware AST passes - Generalise Flask route and template paths to unique /route_N and tpl_N names - Replace descriptive strings with length-preserving, word-consistent msg tokens - Strip docstrings and comments - Add verification for parse validity and leaked benchmark identifiers - Include SAST prompt and expected labels
30 lines
1.1 KiB
Python
30 lines
1.1 KiB
Python
from flask import redirect as mod_1, url_for as mod_2, request as mod_3, make_response as mod_4, render_template as mod_5
|
|
from helpers.utils import escape_for_html as mod_6
|
|
|
|
def init(var_1):
|
|
|
|
@var_1.route('/route_196', methods=['GET'])
|
|
def func_391():
|
|
return func_392()
|
|
|
|
@var_1.route('/route_196', methods=['POST'])
|
|
def func_392():
|
|
var_2 = ''
|
|
var_3 = mod_3.args.get('msg00000000000002Q')
|
|
if not var_3:
|
|
var_3 = ''
|
|
from flask import make_response as mod_4
|
|
import io as mod_7
|
|
import helpers.utils
|
|
var_4 = ''
|
|
if isinstance(var_3, str):
|
|
var_4 = var_3.encode('utf-8')
|
|
elif isinstance(var_3, mod_7.IOBase):
|
|
var_4 = var_3.read(1000)
|
|
var_5 = 'msg0000003'
|
|
var_6 = var_4.decode('utf-8')
|
|
var_2 += f"msg0008 msg005: '{var_5}' m00d msg0d '{helpers.utils.escape_for_html(var_6)}' ods msg00a m00g zgp pr msg0h."
|
|
var_2 = mod_4(var_2)
|
|
var_2.set_cookie(var_5, var_6, path=mod_3.path, secure=True, httponly=True)
|
|
return var_2
|