iGLOO-be / cf-curl

cURL in coldfusion
MIT License
4 stars 4 forks source link

Support for User Agent (-A) #15

Open JamoCA opened 4 years ago

JamoCA commented 4 years ago

Many WAFs are configured to block access if the username is empty or if it contains "CURL".

Please add support for specifying a custom user-agent as well as a default user agent.

I've added a default value to the public init function:

variables.useragent = "cf-curl";

and then added this logic to to the private _commandArg function.

if(len(trim(variables.useragent))){
    c.add('-A "#variables.useragent#"');
}