fixing example

This commit is contained in:
mzack 2024-04-15 22:52:21 +02:00
parent ce8c01891c
commit 8b93f27dfe
2 changed files with 6 additions and 6 deletions

View File

@ -3,8 +3,8 @@ package httpx
type Proto string
const (
AUTO Proto = "auto"
HTTP11 Proto = "http11"
HTTP2 Proto = "http2"
HTTP3 Proto = "http3"
UNKNOWN Proto = ""
HTTP11 Proto = "http11"
HTTP2 Proto = "http2"
HTTP3 Proto = "http3"
)

View File

@ -420,7 +420,7 @@ func ParseOptions() *Options {
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)"),
flagSet.BoolVarP(&options.StoreVisionReconClusters, "store-vision-recon-cluster", "svrc", false, "include visual recon clusters (-ss and -sr only)"),
flagSet.StringVarP(&options.Protocol, "protocol", "pr", "auto", "protocol to use (auto, http11)"),
flagSet.StringVarP(&options.Protocol, "protocol", "pr", "", "protocol to use (unknown, http11)"),
)
flagSet.CreateGroup("configs", "Configurations",
@ -672,7 +672,7 @@ func (options *Options) ValidateOptions() error {
options.OutputCDN = "true"
}
if !stringsutil.EqualFoldAny(options.Protocol, string(httpx.AUTO), string(httpx.HTTP11)) {
if !stringsutil.EqualFoldAny(options.Protocol, string(httpx.UNKNOWN), string(httpx.HTTP11)) {
return fmt.Errorf("invalid protocol: %s", options.Protocol)
}