| skipped 14 lines |
15 | 15 | | ) |
16 | 16 | | |
17 | 17 | | type Runner struct { |
18 | | - | Input chan string |
19 | | - | Output chan string |
20 | | - | Result output.Result |
21 | | - | InWg *sync.WaitGroup |
22 | | - | OutWg *sync.WaitGroup |
23 | | - | Options input.Options |
| 18 | + | Input chan string |
| 19 | + | Output chan string |
| 20 | + | Result output.Result |
| 21 | + | UserAgent string |
| 22 | + | InWg *sync.WaitGroup |
| 23 | + | OutWg *sync.WaitGroup |
| 24 | + | Options input.Options |
24 | 25 | | } |
25 | 26 | | |
26 | 27 | | func New(options *input.Options) Runner { |
27 | 28 | | return Runner{ |
28 | | - | Input: make(chan string, options.Concurrency), |
29 | | - | Output: make(chan string, options.Concurrency), |
30 | | - | Result: output.New(), |
31 | | - | InWg: &sync.WaitGroup{}, |
32 | | - | OutWg: &sync.WaitGroup{}, |
33 | | - | Options: *options, |
| 29 | + | Input: make(chan string, options.Concurrency), |
| 30 | + | Output: make(chan string, options.Concurrency), |
| 31 | + | Result: output.New(), |
| 32 | + | UserAgent: golazy.GenerateRandomUserAgent(), |
| 33 | + | InWg: &sync.WaitGroup{}, |
| 34 | + | OutWg: &sync.WaitGroup{}, |
| 35 | + | Options: *options, |
34 | 36 | | } |
35 | 37 | | } |
36 | 38 | | |
| skipped 50 lines |
87 | 89 | | for value := range r.Input { |
88 | 90 | | client := customClient(r.Options.Timeout) |
89 | 91 | | |
90 | | - | result, err := checkCSP(value, dregex, client) |
| 92 | + | result, err := checkCSP(value, r.UserAgent, dregex, client) |
91 | 93 | | if err != nil { |
92 | 94 | | if r.Options.Verbose { |
93 | 95 | | gologger.Error().Msgf("%s", err) |
| skipped 54 lines |