Skip to content

RangeError: Maximum call stack size exceeded #930

@roncli

Description

@roncli

When retrieving enough application/soap+xml; charset=utf-8 data in a SOAP request, httpyac crashes with the following error. I believe it has to do with the raw size of the request, I was able to trigger it consistently around 80 to 90KB.

Error:

[-] Maximum call stack size exceeded (RangeError: Maximum call stack size exceeded - Object.v [as serializeNode] (C:\Users\...\AppData\Roaming\npm\node_modules\httpyac\node_modules\xmldom-format\dist\index.js:2:3922)
RangeError: Maximum call stack size exceeded
    at Object.v [as serializeNode] (C:\Users\...\AppData\Roaming\npm\node_modules\httpyac\node_modules\xmldom-format\dist\index.js:2:3922)
    at O (C:\Users\...\AppData\Roaming\npm\node_modules\httpyac\node_modules\xmldom-format\dist\index.js:2:893)
[-] Maximum call stack size exceeded (RangeError: Maximum call stack size exceeded - Object.v [as serializeNode] (C:\Users\...\AppData\Roaming\npm\node_modules\httpyac\node_modules\xmldom-format\dist\index.js:2:3922)
RangeError: Maximum call stack size exceeded
    at Object.v [as serializeNode] (C:\Users\...\AppData\Roaming\npm\node_modules\httpyac\node_modules\xmldom-format\dist\index.js:2:3922)
    at O (C:\Users\...\AppData\Roaming\npm\node_modules\httpyac\node_modules\xmldom-format\dist\index.js:2:893)

To reproduce:

  • Create a large XML file:
<?xml version="1.0" encoding="UTF-8"?>
<messages>
    <message>
        <id>1</id>
    </message>
    <message>
        <id>1</id>
    </message>
    .... repeat until you have a total of 10,000 message blocks
</messages>
  • Create a test HTTP server where that XML file is downloaded on a post. Example:
            res.contentType("application/soap+xml; charset=utf-8");
            res.download("./public/test.asmx");
  • Create the following test.http file, replacing your server information as necessary:
POST http://localhost:8080/test.asmx HTTP/1.1
Host: localhost:8080
Content-Type: application/soap+xml; charset=utf-8

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
        <GetMessages xmlns="Messages">
            <clientID>1</clientID>
        </GetMessages>
    </soap12:Body>
</soap12:Envelope>
  • Run httpyac:
npx httpyac send ./test.http --all

Expected result: The XML document is returned as expected.

Actual result: The above error.

This also affects the VSCode extension.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions