Skip to content

HAR output only saved if command was successful #55

@superpupervlad

Description

@superpupervlad

I want to check requests of the command which crashes with error and exits with code 1 in the end. httptap prints requests of this command but doesn't saves it to har file.
Example with empty har file:

$ cat test   
#!/bin/bash
curl https://monasticacademy.org
exit 1
$ ./httptap --dump-har out.har -- ./test
Redirecting...
---> GET https://monasticacademy.org/
<--- 308 https://monasticacademy.org/ (15 bytes)
$ cat out.har
<nothing here>

Quick fix is to add this command to bash file and exit 0

$ cat test             
#!/bin/bash
curl https://monasticacademy.org
exit 0
$ ./httptap --dump-har out.har -- ./test
---> GET https://monasticacademy.org/
<--- 308 https://monasticacademy.org/ (15 bytes)
Redirecting...
$ cat out.har 
{"log":{"version":"1.2","creator":{"name":"github.com/vvakame/go-harlog"
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions