1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-29 03:55:49 +01:00

Bangle.js: Added PATCH HTTP request type, and fix for VolleyError UnsupportedOperationException when supplying custom headers

This commit is contained in:
Gordon Williams 2022-09-26 11:52:24 +01:00 committed by Gitea
parent 6732bab481
commit abec54fb1a

View File

@ -568,6 +568,7 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
else if (m.equals("post")) method = Request.Method.POST;
else if (m.equals("head")) method = Request.Method.HEAD;
else if (m.equals("put")) method = Request.Method.PUT;
else if (m.equals("patch")) method = Request.Method.PATCH;
else if (m.equals("delete")) method = Request.Method.DELETE;
else uartTxJSONError("http", "Unknown HTTP method "+m,id);
}
@ -640,7 +641,8 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> h = super.getHeaders();
// clone the data from super.getHeaders() so we can write to it
Map<String, String> h = new HashMap<>(super.getHeaders());
if (headers != null) {
Iterator<String> iter = headers.keySet().iterator();
while (iter.hasNext()) {