mirror of https://github.com/daffainfo/nuclei.git
remove redundant contains function
parent
e2b39e403c
commit
5115c8b58c
|
@ -180,12 +180,6 @@ func (c *Client) firstTimeInitializeClient() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func hash(s string) string {
|
|
||||||
h := sha1.New()
|
|
||||||
h.Write([]byte(s))
|
|
||||||
return hex.EncodeToString(h.Sum(nil))
|
|
||||||
}
|
|
||||||
|
|
||||||
// processInteractionForRequest processes an interaction for a request
|
// processInteractionForRequest processes an interaction for a request
|
||||||
func (c *Client) processInteractionForRequest(interaction *server.Interaction, data *RequestData) bool {
|
func (c *Client) processInteractionForRequest(interaction *server.Interaction, data *RequestData) bool {
|
||||||
data.Event.InternalEvent["interactsh_protocol"] = interaction.Protocol
|
data.Event.InternalEvent["interactsh_protocol"] = interaction.Protocol
|
||||||
|
@ -348,12 +342,8 @@ func debugPrintInteraction(interaction *server.Interaction) {
|
||||||
fmt.Fprint(os.Stderr, builder.String())
|
fmt.Fprint(os.Stderr, builder.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
// contains returns true if the given string is in the given array
|
func hash(s string) string {
|
||||||
func contains(array []string, str string) bool {
|
h := sha1.New()
|
||||||
for _, s := range array {
|
h.Write([]byte(s))
|
||||||
if s == str {
|
return hex.EncodeToString(h.Sum(nil))
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue