gr-rest-api-impl: Remove duplicate base url from _fetchB64File
We add the base url within fetch. We don't need to supply it to it.
As it just leads to a duplicate base url breaking things.
Release-Notes: gr-rest-api-impl: Remove duplicate base url from _fetchB64File
Change-Id: I4ef40ca7f6688e6c2c7abe6036e4ef2daac5e3ed
diff --git a/polygerrit-ui/app/services/gr-rest-api/gr-rest-api-impl.ts b/polygerrit-ui/app/services/gr-rest-api/gr-rest-api-impl.ts
index b7eb7ac..2a10893 100644
--- a/polygerrit-ui/app/services/gr-rest-api/gr-rest-api-impl.ts
+++ b/polygerrit-ui/app/services/gr-rest-api/gr-rest-api-impl.ts
@@ -8,7 +8,6 @@
import {GrEtagDecorator} from '../../elements/shared/gr-rest-api-interface/gr-etag-decorator';
import {GrReviewerUpdatesParser} from '../../elements/shared/gr-rest-api-interface/gr-reviewer-updates-parser';
import {parseDate} from '../../utils/date-util';
-import {getBaseUrl} from '../../utils/url-util';
import {getParentIndex, isMergeParent} from '../../utils/patch-set-util';
import {listChangesOptionsToHex} from '../../utils/change-util';
import {assertNever, hasOwnProperty} from '../../utils/common-util';
@@ -2871,17 +2870,15 @@
}
_fetchB64File(url: string): Promise<Base64File> {
- return this._restApiHelper
- .fetch({url: getBaseUrl() + url})
- .then(response => {
- if (!response.ok) {
- return Promise.reject(new Error(response.statusText));
- }
- const type = response.headers.get('X-FYI-Content-Type');
- return response.text().then(text => {
- return {body: text, type};
- });
+ return this._restApiHelper.fetch({url}).then(response => {
+ if (!response.ok) {
+ return Promise.reject(new Error(response.statusText));
+ }
+ const type = response.headers.get('X-FYI-Content-Type');
+ return response.text().then(text => {
+ return {body: text, type};
});
+ });
}
getB64FileContents(