commit 9d1262c75a98c32100cbd074e62f59fe40c27d55 parent 08166af919024cf5e6dcdfadf67d5674c71790c3 Author: Florian Dold <florian@dold.me> Date: Mon, 9 Sep 2024 16:30:46 +0200 taler-util: content type header hotfix Diffstat:
| M | packages/taler-util/src/http-impl.qtart.ts | | | 11 | ++++++++++- |
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/packages/taler-util/src/http-impl.qtart.ts b/packages/taler-util/src/http-impl.qtart.ts @@ -195,7 +195,16 @@ export class HttpLibImpl implements HttpRequestLibrary { continue; } const headerName = headerStr.slice(0, splitPos).trim().toLowerCase(); - const headerValue = headerStr.slice(splitPos + 1).trim(); + let headerValue = headerStr.slice(splitPos + 1).trim(); + // FIXME: This is a hotfix for the broken native networking implementation on Android + // that sends the content type header value in square brackets + if ( + headerName === "content-type" && + headerValue.startsWith("[") && + headerValue.endsWith("]") + ) { + headerValue = headerValue.substring(1, headerValue.length - 2); + } headers.set(headerName, headerValue); } }