Skip to content

Pre-Run script is run PRIOR to path substitution #1754

@MobileVet

Description

@MobileVet

Describe the bug
Pre-run scripts appear to run prior to path substitutions. As a result, if your path is part of an HMAC that is calculated during a pre-run script, it won't have the correct values.

To Reproduce

  • Make a Pre-Run script with a single line
tc.request.setHeader("X-Debug", JSON.stringify(tc.request.url))
  • Define an endpoint to be called
            "url": "/api/v1/exams/{examMetadataId}/questions",
            "method": "GET",
            "params": [
                {
                    "name": "examMetadataId",
                    "value": "deadbeef01",
                    "isPath": true
                }
  ]
  • Call the endpoint
  • Read the sent headers
  • Notice that X-Debug = http://localhost:5100/api/v1/exams/{examMetadata}/questions

Expected behavior

  • The header has the URL with deadbeef01 substituted for {examMetadata}
  • X-Debug = http://localhost:5100/api/v1/exams/deadbeef01/questions

Platform:

  • OS: macOS 14.6.1
  • vscode version: Version: 1.119.0 (Universal), Commit: 8b640eef5a6c6089c029249d48efa5c99adf7d51
  • node version: 22.21.1
  • extension version: 2.40.12
  • Paid account

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions