Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POC编写报错问题 #1732

Open
doritNN opened this issue May 9, 2023 · 1 comment
Open

POC编写报错问题 #1732

doritNN opened this issue May 9, 2023 · 1 comment

Comments

@doritNN
Copy link

doritNN commented May 9, 2023

我的期望是匹配GET请求URI中的参数,并遍历每次删除一个后发起请求与原请求的响应比对,但是使用模版进行循环的时候导入xrayh会报错,看看谁能给我debug一下。

name: poc-yaml-FuzzDeleteParam
manual: false
transport: http
set:
inputPath: request.url.path
inputQuery: request.url.query
params: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
rules:
r0:
request:
cache: true
method: GET
# 获取原始路径并删除所有参数
path: '{{inputPath}}'
expression: "true"
output:
response: response.raw
{{#params}}
r{{@Index}}:
request:
cache: true
method: GET
# 逐个删除参数并比对返回包内容是否一致
path: '{{inputPath}}?{{inputQuery}}' | replace('(.)([?&]){{this}}=[^&](?:&|$)', '$1') | replace('&$', '')
expression: "diff(r0.response, response.raw) == ''"
output:
diff: diff(r0.response, response.raw)
{{/params}}
expression: "{{#rules}} {{.}}() && {{/rules}} true"

@mashiro01
Copy link
Collaborator

师傅可否给一个用代码块包裹的yaml内容,现在给出的信息无法分辨出yaml具体的缩进范围

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants