From e5f489a946137e58cf8c2941fe525f0e07fe06fb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tibor=20Kr=C3=A1l?= Date: Mon, 9 Nov 2020 15:59:12 +0100 Subject: [PATCH] Clear the initial content-type for DELETE requests MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The content-type was initialized to application/json. Therefore it was applied even for the DELETE request where it is not needed. When initialized with NULL text/plain will be used instead. JIRA: NETCONF-732 Change-Id: If369baccfb9b478ff8857a9da7ebd5c1173e4c8d Signed-off-by: Tibor Král (cherry picked from commit 849e00b3147552250e1713032aa6ff7c478577ab) --- .../sal-rest-docgen/src/main/resources/explorer/lib/swagger.js | 3 +++ .../src/main/resources/explorer/static/swagger.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/restconf/sal-rest-docgen/src/main/resources/explorer/lib/swagger.js b/restconf/sal-rest-docgen/src/main/resources/explorer/lib/swagger.js index e45e62f815..0a393ea1fb 100644 --- a/restconf/sal-rest-docgen/src/main/resources/explorer/lib/swagger.js +++ b/restconf/sal-rest-docgen/src/main/resources/explorer/lib/swagger.js @@ -951,6 +951,9 @@ requestContentType = this.opts.requestContentType; } } else { + if (this.type === "DELETE") { + requestContentType = null; + } if (((function() { var _i, _len, _ref, _results; _ref = this.operation.parameters; diff --git a/restconf/sal-rest-docgen/src/main/resources/explorer/static/swagger.js b/restconf/sal-rest-docgen/src/main/resources/explorer/static/swagger.js index a03779011b..ba81b35de2 100644 --- a/restconf/sal-rest-docgen/src/main/resources/explorer/static/swagger.js +++ b/restconf/sal-rest-docgen/src/main/resources/explorer/static/swagger.js @@ -906,6 +906,9 @@ requestContentType = this.opts.requestContentType; } } else { + if (this.type === "DELETE") { + requestContentType = null; + } if (((function() { var _i, _len, _ref, _results; _ref = this.operation.parameters; -- 2.36.6