@bytescale/sdk 3.0.0-alpha.17 → 3.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2753,14 +2753,17 @@ var AuthManager = /*#__PURE__*/function (_BaseAPI) {
2753
2753
  value: function getAccessToken(authUrl, headers) {
2754
2754
  try {
2755
2755
  var _this13 = this;
2756
+ var _a;
2756
2757
  var endpointName = "Your auth API endpoint";
2757
2758
  var requiredContentType = _this13.contentTypeText;
2758
2759
  return AuthManagerBrowser_await(_this13.doFetch(authUrl, {
2759
2760
  method: "GET",
2760
2761
  headers: headers
2761
2762
  }, false), function (result) {
2762
- if (result.headers.get(_this13.contentType) !== requiredContentType) {
2763
- throw new Error("".concat(endpointName, " returned an unsupported '").concat(_this13.contentType, "' response header: please return '").concat(requiredContentType, "'."));
2763
+ var actualContentType = (_a = result.headers.get(_this13.contentType)) !== null && _a !== void 0 ? _a : "";
2764
+ // Support content types like "text/plain; charset=utf-8" and "text/plain"
2765
+ if (actualContentType.split(";")[0] !== requiredContentType) {
2766
+ throw new Error("".concat(endpointName, " returned \"").concat(actualContentType, "\" for the ").concat(_this13.contentType, " response header, but the Bytescale SDK requires \"").concat(requiredContentType, "\"."));
2764
2767
  }
2765
2768
  return AuthManagerBrowser_await(result.text(), function (jwt) {
2766
2769
  if (jwt.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytescale/sdk",
3
- "version": "3.0.0-alpha.17",
3
+ "version": "3.0.0-alpha.18",
4
4
  "description": "Bytescale JavaScript SDK",
5
5
  "author": "Bytescale <hello@bytescale.com> (https://www.bytescale.com)",
6
6
  "license": "MIT",