ember-arcgis-portal-services
Advanced tools
Comparing version 1.3.1 to 1.3.2
import { copy } from '@ember/object/internals'; | ||
import Service from '@ember/service'; | ||
import serviceMixin from '../mixins/service-mixin'; | ||
import getImageAsBlob from 'ember-arcgis-portal-services/utils/get-image-as-blob'; | ||
import fetchImageAsBlob from 'ember-arcgis-portal-services/utils/fetch-image-as-blob'; | ||
@@ -131,3 +131,3 @@ export default Service.extend(serviceMixin, { | ||
addImageResourceFromUrl (itemId, owner, filename, url) { | ||
return getImageAsBlob(url) | ||
return fetchImageAsBlob(url) | ||
.then((blob) => { | ||
@@ -134,0 +134,0 @@ // upload as a resources |
@@ -5,4 +5,7 @@ /** | ||
*/ | ||
export default function fetchImageAsBlob (url) { | ||
return fetch(url) | ||
export default function fetchImageAsBlob (url, options = {}) { | ||
if (!options.credentials) { | ||
options.credentials = 'same-origin'; | ||
} | ||
return fetch(url, options) | ||
.then((response) => { | ||
@@ -9,0 +12,0 @@ return response.blob(); |
@@ -7,2 +7,3 @@ import { Promise as EmberPromise } from 'rsvp'; | ||
export default function getImageAsBlob (sourceUrl) { | ||
console.error(`DEPRECATION: getImageAsBlob utility is deprecated! Please use fetchImageAsBlob instead as it will work with web-tier authentication.`); | ||
// promisify this... | ||
@@ -9,0 +10,0 @@ return new EmberPromise((resolve, reject) => { |
@@ -5,2 +5,7 @@ # Change Log | ||
## 1.3.2 | ||
### Changed | ||
- `utils/fetch-image-as-blob.js` sends same-origin credentials by default | ||
- `item-service:addImageResourceFromUrl` now uses `fetch-image-as-blob` | ||
## 1.3.1 | ||
@@ -7,0 +12,0 @@ ### Fixed |
{ | ||
"name": "ember-arcgis-portal-services", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "A set of promise-based Ember Services for working with the ArcGIS Portal API.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87049
1473