Skip to content

Commit

Permalink
fix: no bearer auth on iiif images (#1410)
Browse files Browse the repository at this point in the history
  • Loading branch information
derschnee68 committed Jan 30, 2024
1 parent 515da21 commit a5a00e9
Showing 1 changed file with 1 addition and 18 deletions.
Expand Up @@ -15,23 +15,6 @@ export class RepresentationService {
* @returns an object containing the knora.json file for the given file url
*/
getFileInfo(url: string, imageFilename?: string): Observable<unknown> {
const token = this._getTokenFromLocalStorage();

const headersConfig: { [header: string]: string } = {
'Content-Type': 'application/json',
};

// if there is no token, we won't add any auth header, so sipi returns
// a json if the resource is not restricted
if (token) {
headersConfig['Authorization'] = `Bearer ${token}`;
}

const requestOptions = {
headers: new HttpHeaders(headersConfig),
withCredentials: true,
};

let pathToJson = '';

if (imageFilename) {
Expand All @@ -41,7 +24,7 @@ export class RepresentationService {
pathToJson = `${url.substring(0, url.lastIndexOf('/'))}/knora.json`;
}

return this._http.get(pathToJson, requestOptions);
return this._http.get(pathToJson);
}

/**
Expand Down

0 comments on commit a5a00e9

Please sign in to comment.