File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -128,8 +128,13 @@ func NewRequest(
128128 req .Header .Set ("Accept" , "application/json" )
129129 }
130130
131- // set azurehound as user-agent
132- req .Header .Set ("User-Agent" , constants .UserAgent ())
131+ // set azurehound as user-agent, use custom if set in config
132+ ua := config .UserAgent .Value ()
133+ if s , ok := ua .(string ); ok && s != "" {
134+ req .Header .Set ("User-Agent" , s )
135+ } else {
136+ req .Header .Set ("User-Agent" , constants .UserAgent ())
137+ }
133138 return req , nil
134139 }
135140}
Original file line number Diff line number Diff line change @@ -354,6 +354,14 @@ var (
354354 Default : "" ,
355355 }
356356
357+ UserAgent = Config {
358+ Name : "user-agent" ,
359+ Shorthand : "U" ,
360+ Usage : "Custom User-Agent header" ,
361+ Persistent : true ,
362+ Default : "" ,
363+ }
364+
357365 GlobalConfig = []Config {
358366 ConfigFile ,
359367 VerbosityLevel ,
@@ -363,6 +371,7 @@ var (
363371 Proxy ,
364372 RefreshToken ,
365373 Pprof ,
374+ UserAgent ,
366375 }
367376
368377 AzureConfig = []Config {
You can’t perform that action at this time.
0 commit comments