@knime/utils
Advanced tools
+6
-0
| # @knime/utils | ||
| ## 1.9.0 | ||
| ### Minor Changes | ||
| - c4bd90d: treat etags in upload as optional, adjust docs | ||
| ## 1.8.0 | ||
@@ -4,0 +10,0 @@ |
+1
-1
| { | ||
| "name": "@knime/utils", | ||
| "version": "1.8.0", | ||
| "version": "1.9.0", | ||
| "description": "Internal utility functions and constants shared across @knime packages.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -31,2 +31,3 @@ import { AbortError, createAbortablePromise, retryPromise } from "../promise"; | ||
| const OK = 200; | ||
| const CREATED = 201; | ||
@@ -48,13 +49,9 @@ return new Promise<{ partId: string }>((resolve, reject) => { | ||
| xhr.onload = () => { | ||
| if (xhr.status === OK) { | ||
| if (xhr.status === OK || xhr.status === CREATED) { | ||
| const etag = xhr.getResponseHeader("ETag"); | ||
| if (!etag) { | ||
| reject(new Error("Invalid part upload response")); | ||
| return; | ||
| } | ||
| // remove possible doublequotes (") around the etag and/or weak identifier (if either is present) | ||
| // 1. note that some backends don't return the etag header, then we just set an empty string | ||
| // 2. remove possible doublequotes (") around the etag and/or weak identifier (if either is present) | ||
| // https://datatracker.ietf.org/doc/html/rfc7232#section-2.3 | ||
| resolve({ partId: etag.replace(/^(?:W\/)?"|"$/g, "") }); | ||
| resolve({ partId: etag?.replace(/^(?:W\/)?"|"$/g, "") ?? "" }); | ||
| } else { | ||
@@ -61,0 +58,0 @@ consola.error("Failed or unexpected XHR response", { |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
97399
0.14%1592
-0.13%