Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
Description
Issue Summary
When a rest API is used to via applink to Bitbucket from Confluence, the DELETE method fails with 405 code.
Steps to reproduce
We created a local bitbucket instance with a project titled TEST and added the users named admin and syed respectively. On Confluence, we created a page with the HTML macro and the script to test the GET and DELETE method via REST API.
As you noticed in your environment, the GET method to fetch the project permissions is successful. See the screenshot below:
However, the delete errors our with 405 response:
Now, for further analysis, we tried to test the behavior for the DELETE method with and without the applink proxy. We used curl to eliminate any possible interference from Confluence other than the applinks. We noticed when we test the REST API without the applink proxy, the response is successful. However, when we go via the applink proxy, the response fails with 405. See below:
spasha$ curl -i -u admin:admin -X DELETE http://localhost:7990/rest/api/1.0/projects/TEST/permissions/users?name=syed
HTTP/1.1 204
X-AREQUESTID: @19URQ2Fx971x1166x0
X-ASEN: SEN-500
X-AUSERID: 1
X-AUSERNAME: admin
Cache-Control: no-cache, no-transform
Vary: X-AUSERNAME
Vary: X-AUSERID
Vary: Cookie
X-Content-Type-Options: nosniff
Content-Type: application/json;charset=UTF-8
Date: Fri, 12 Jun 2020 10:41:22 GMT
spasha$ curl -i -X DELETE http://localhost:5050/plugins/servlet/applinks/proxy?appId=5114cdc7-9eac-3480-9935-7bdefef63690&path=/rest/api/1.0/projects/TEST/permissions/users?name=syed [1] 29590 C02X63V3JG5J:~ spasha$ HTTP/1.1 405 X-Confluence-Request-Time: 1591949929076 Content-Type: text/html;charset=utf-8 Content-Language: en Content-Length: 1119 Date: Fri, 12 Jun 2020 08:18:49 GMT <!doctype html><html lang="en"><head><title>HTTP Status 405 – Method Not Allowed</title><style type="text/css">h1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 405 – Method Not Allowed</h1><hr class="line" /><p><b>Type</b> Status Report</p><p><b>Message</b> Http method DELETE is not supported by this URL</p><p><b>Description</b> The method received in the request-line is known by the origin server but not supported by the target resource.</p><hr class="line" /><h3>Apache Tomcat/9.0.12</h3></body></html> [1]+ Done curl -i -X DELETE http://localhost:5050/plugins/servlet/applinks/proxy?appId=5114cdc7-9eac-3480-9935-7bdefef63690
If you notice closely, we see that the Http method DELETE is not supported when passed via the applink proxy.
Expected Results
The rest call for DELETE via applink should delete the user from a project on Bitbucket.