Skip to content

Commit

Permalink
Make output response fields public (#1266)
Browse files Browse the repository at this point in the history
* Make output response fields public so they can be specified if httpx used as a library.

* Fix runner.go to use renamed params.

* renaming var

---------

Co-authored-by: mzack <[email protected]>
  • Loading branch information
jnovikov and Mzack9999 authored Jul 19, 2023
1 parent b3de0bc commit 9e1242d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ type Options struct {
NoColor bool
OutputServerHeader bool
OutputWebSocket bool
responseInStdout bool
base64responseInStdout bool
ResponseInStdout bool
Base64ResponseInStdout bool
chainInStdout bool
FollowHostRedirects bool
MaxRedirects int
Expand Down Expand Up @@ -381,8 +381,8 @@ func ParseOptions() *Options {
flagSet.BoolVar(&options.CSVOutput, "csv", false, "store output in csv format"),
flagSet.StringVarP(&options.CSVOutputEncoding, "csv-output-encoding", "csvo", "", "define output encoding"),
flagSet.BoolVar(&options.JSONOutput, "json", false, "store output in JSONL(ines) format"),
flagSet.BoolVarP(&options.responseInStdout, "include-response", "irr", false, "include http request/response in JSON output (-json only)"),
flagSet.BoolVarP(&options.base64responseInStdout, "include-response-base64", "irrb", false, "include base64 encoded http request/response in JSON output (-json only)"),
flagSet.BoolVarP(&options.ResponseInStdout, "include-response", "irr", false, "include http request/response in JSON output (-json only)"),
flagSet.BoolVarP(&options.Base64ResponseInStdout, "include-response-base64", "irrb", false, "include base64 encoded http request/response in JSON output (-json only)"),
flagSet.BoolVar(&options.chainInStdout, "include-chain", false, "include redirect http chain in JSON output (-json only)"),
flagSet.BoolVar(&options.StoreChain, "store-chain", false, "include http redirect chain in responses (-sr only)"),
)
Expand Down
4 changes: 2 additions & 2 deletions runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ func New(options *Options) (*Runner, error) {
scanopts.StoreResponseDirectory = options.StoreResponseDir
scanopts.OutputServerHeader = options.OutputServerHeader
scanopts.OutputWithNoColor = options.NoColor
scanopts.ResponseInStdout = options.responseInStdout
scanopts.Base64ResponseInStdout = options.base64responseInStdout
scanopts.ResponseInStdout = options.ResponseInStdout
scanopts.Base64ResponseInStdout = options.Base64ResponseInStdout
scanopts.ChainInStdout = options.chainInStdout
scanopts.OutputWebSocket = options.OutputWebSocket
scanopts.TLSProbe = options.TLSProbe
Expand Down

0 comments on commit 9e1242d

Please sign in to comment.