Skip to content

[Bug]: nex-viewer rewrite fails to load .chls (Charles Proxy) files with dropped HTTP connections #41

Description

@AntogamerYT

Checked Existing

  • I have checked the repository for duplicate issues.

What happened?

While loading a Charles Proxy dump which has other requests (including dropped connections) than the NEX WebSocket itself, the program logged an error related to not being able to read description in CharlesHTTPResponse's constructor:

(node:41324) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of null (reading 'description')
    at new CharlesHTTPResponse (E:\dev\nex-viewer\src\charles-parser.ts:215:85)
    at new CharlesHTTPTransaction (E:\dev\nex-viewer\src\charles-parser.ts:295:20)
    at CharlesParser.parse (E:\dev\nex-viewer\src\charles-parser.ts:28:24)
    at new CharlesParser (E:\dev\nex-viewer\src\charles-parser.ts:18:8)
    at Session.parseCharles (E:\dev\nex-viewer\src\nex\session.ts:79:18)
    at Session.parse (E:\dev\nex-viewer\src\nex\session.ts:40:9)
    at openSession (E:\dev\nex-viewer\src\windows\main\menu.ts:20:10)
    at click (E:\dev\nex-viewer\src\windows\main\menu.ts:91:7)
(Use `electron --trace-warnings ...` to show where the warning was created)

What did you expect to happen?

I expected the program to simply ignore the request and move on by continuing to parse the other HTTP requests in the file

Steps to reproduce?

  1. Get a .chls dump which has 1 or more dropped requests
    • The best way to make a reproducible dump is to block a domain via Charles' Block List (Tools -> Block List) with the blocking action set to Drop connection
  2. Load it in nex-viewer

Other relevant information. (OPTIONAL)

This is caused by the responseHeader being null in dropped connections, therefore nex-viewer throws an error while trying to access the HTTP status of the request

Metadata

Metadata

Assignees

No one assigned

    Labels

    approvedThe topic is approved by a developerbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions