cyrus-and / chrome-har-capturer

Capture HAR files from a Chrome instance
MIT License
535 stars 90 forks source link

Weird behavior when passing invalid URLs #1

Closed cyrus-and closed 11 years ago

cyrus-and commented 11 years ago

It seems that Chrome aborts a request after an invalid one.

First invalid request http://asd:

{
    "method": "Network.requestWillBeSent",
    "params": {
        "requestId": "9.1",
        "frameId": "9.2",
        "loaderId": "9.1",
        "documentURL": "http://asd/",
        "request": {
            "url": "http://asd/",
            "method": "GET",
            "headers": {
                "Pragma": "no-cache",
                "User-Agent": [...],
                "Accept": [...],
                "Cache-Control": "no-cache"
            }
        },
        "timestamp": 1355765429.950094,
        "initiator": {
            "type": "other"
        }
    }
}

Loading failed notify:

{
    "method": "Network.loadingFailed",
    "params": {
        "requestId": "9.1",
        "timestamp": 1355765429.989708,
        "errorText": ""
    }
}

Next valid request http://flickr.com:

{
    "method": "Network.requestWillBeSent",
    "params": {
        "requestId": "9.3",
        "frameId": "9.2",
        "loaderId": "9.4",
        "documentURL": "http://flickr.com/",
        "request": {
            "url": "http://flickr.com/",
            "method": "GET",
            "headers": {
                "Pragma": "no-cache",
                "User-Agent": [...],
                "Accept": [...],
                "Cache-Control": "no-cache"
            }
        },
        "timestamp": 1355765430.012913,
        "initiator": {
            "type": "other"
        }
    }
}

Request cancelled by Chrome:

{
    "method": "Network.loadingFailed",
    "params": {
        "requestId": "9.3",
        "timestamp": 1355765430.319519,
        "errorText": "",
        "canceled": true
    }
}
cyrus-and commented 11 years ago

It seems that a further valid request gets properly honored, reproduce with:

$ chrome-har-capturer http://asd http://flickr.com http://reddit.com -o out.har
[ DONE ] http://asd        # fail    (right)
[ DONE ] http://flickr.com # fail    (wrong)
[ DONE ] http://reddit.com # success (right)
cyrus-and commented 11 years ago

Unable to reproduce this bug... closing.