File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 33//You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
44//author:@haseebeqx
55
6+ // Note: The following code lives also in Script Console add-on.
7+
68function invokeWith ( msg ) {
79 var string = "curl -i -s -k -X '" + msg . getRequestHeader ( ) . getMethod ( ) + "' \\\n" ;
810 var header = msg . getRequestHeader ( ) . getHeadersAsString ( ) ;
@@ -13,11 +15,14 @@ function invokeWith(msg) {
1315 if ( headerEntry . startsWith ( "@" ) ) {
1416 suspiciousHeaders = true ;
1517 }
16- //blacklisting Host (other blacklisting should also specify here
18+ // deny listing Host (other deny listing should also specify here)
1719 var keyval = headerEntry . split ( ":" ) ;
1820 if ( keyval [ 0 ] . trim ( ) != "Host" )
1921 string += " -H '" + headerEntry + "' " ;
2022 }
23+ // if no User-Agent present ensures that curl request doesn't add one
24+ if ( string . indexOf ( "User-Agent" ) < 0 )
25+ string += " -A '' " ;
2126 string += " \\\n" ;
2227 var body = msg . getRequestBody ( ) . toString ( ) ;
2328 if ( body . length ( ) != 0 ) {
You can’t perform that action at this time.
0 commit comments