Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PayloadParser ¶
type PayloadParser struct {
// contains filtered or unexported fields
}
func NewPayload ¶
func NewPayload(args *arguments.Arguments) *PayloadParser
func (*PayloadParser) EnsureProtocol ¶
func (p *PayloadParser) EnsureProtocol(link string) string
EnsureProtocol verifies that the provided link has a protocol prefix. If the link does not start with "http://" or "https://", it prepends "https://" to the link. The function trims any leading or trailing whitespace from the link before checking the protocol. It returns the modified or unmodified link with the appropriate protocol.
func (*PayloadParser) ProcessPayloadsAndHeaders ¶
func (p *PayloadParser) ProcessPayloadsAndHeaders(limiter *rate.Limiter, link string, payloads []string, headers []string)
processPayloadsAndHeaders reads lines from standard input, and for each line, sends a request with each payload to each header to the specified link.
The function takes in a slice of payloads, a slice of headers, and booleans indicating whether to append the payload to the parameter, whether to test parameters, and whether to follow redirects. It also takes a client object with a timeout and a redirect policy.
If there is an error reading the input, that error is printed to standard error. Otherwise, the function prints nothing and returns no value.
func (*PayloadParser) ReadLinesFromFile ¶
func (p *PayloadParser) ReadLinesFromFile() ([]string, error)
readLinesFromFile reads a file line by line and returns the lines as a slice of strings.
The lines are trimmed of whitespace. If there is an error reading the file, that error is returned. Otherwise, the function returns a slice of strings and a nil error.