Clear the initial content-type for DELETE requests 49/93649/1 stable/sodium
authorTibor Král <tibor.kral@pantheon.tech>
Mon, 9 Nov 2020 14:59:12 +0000 (15:59 +0100)
committerRobert Varga <nite@hq.sk>
Tue, 10 Nov 2020 14:18:34 +0000 (14:18 +0000)
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 <tibor.kral@pantheon.tech>
(cherry picked from commit 849e00b3147552250e1713032aa6ff7c478577ab)

restconf/sal-rest-docgen/src/main/resources/explorer/lib/swagger.js
restconf/sal-rest-docgen/src/main/resources/explorer/static/swagger.js

index e45e62f815bee875128d228470717489e7ff7449..0a393ea1fb271e81e4b5c1a9462a832b34e147b9 100644 (file)
           requestContentType = this.opts.requestContentType;
         }
       } else {
+        if (this.type === "DELETE") {
+          requestContentType = null;
+        }
         if (((function() {
           var _i, _len, _ref, _results;
           _ref = this.operation.parameters;
index a03779011b11e27c12e750ef42e25852f3326818..ba81b35de247f34d128d7e99cd0000f35e340c5d 100644 (file)
           requestContentType = this.opts.requestContentType;
         }
       } else {
+        if (this.type === "DELETE") {
+          requestContentType = null;
+        }
         if (((function() {
           var _i, _len, _ref, _results;
           _ref = this.operation.parameters;