fix: convert HTTP method to lowercase when parsing cURL commands (#31704)

Co-authored-by: jiasiqi <jiasiqi3@tal.com>
This commit is contained in:
JQSevenMiao 2026-01-29 15:37:37 +08:00 committed by GitHub
parent 0934b89da9
commit 4f2cd40498
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ const parseCurl = (curlCommand: string): { node: HttpNodeType | null, error: str
case '--request':
if (i + 1 >= args.length)
return { node: null, error: 'Missing HTTP method after -X or --request.' }
node.method = (args[++i].replace(/^['"]|['"]$/g, '') as Method) || Method.get
node.method = (args[++i].replace(/^['"]|['"]$/g, '').toLowerCase() as Method) || Method.get
hasData = true
break
case '-H':