File tree Expand file tree Collapse file tree 2 files changed +3
-12
lines changed
subprojects/zap-clientapi/src/main/java/org/zaproxy/clientapi/core Expand file tree Collapse file tree 2 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
55and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
66
77## [ Unreleased]
8+ ### Changed
9+ - Stop sending the API key as query parameter, not needed since ZAP 2.6.0.
10+
811### Deprecated
912- The following APIs were deprecated:
1013 - ` Exportreport `
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ public class ClientApi {
9292 private static final int DEFAULT_CONNECTION_POOLING_IN_MS = 1000 ;
9393
9494 private static final String ZAP_API_KEY_HEADER = "X-ZAP-API-Key" ;
95- private static final String ZAP_API_KEY_PARAM = "apikey" ;
9695
9796 private Proxy proxy = new Proxy (Proxy .Type .HTTP , new InetSocketAddress ("localhost" , 8090 ));
9897 private boolean debug = false ;
@@ -486,10 +485,6 @@ private HttpRequest buildZapRequest(
486485 sb .append (method );
487486 sb .append ('/' );
488487 if (params != null ) {
489- if (apiKey != null && !apiKey .isEmpty ()) {
490- params .put (ZAP_API_KEY_PARAM , apiKey );
491- }
492-
493488 sb .append ('?' );
494489 for (Map .Entry <String , String > p : params .entrySet ()) {
495490 sb .append (encodeQueryParam (p .getKey ()));
@@ -499,13 +494,6 @@ private HttpRequest buildZapRequest(
499494 }
500495 sb .append ('&' );
501496 }
502- } else if (apiKey != null && !apiKey .isEmpty ()) {
503- // Send the API key even if there are no parameters,
504- // older ZAP versions might need it as (query) parameter.
505- sb .append ('?' );
506- sb .append (encodeQueryParam (ZAP_API_KEY_PARAM ));
507- sb .append ('=' );
508- sb .append (encodeQueryParam (apiKey ));
509497 }
510498
511499 HttpRequest request = new HttpRequest (createUrl (sb .toString ()));
You can’t perform that action at this time.
0 commit comments