Skip to content

Commit b3d34e3

Browse files
authored
Merge pull request #216 from mschoettle/fix-attachment-url
Change GitLab attachment URL to current one
2 parents 9b319cb + 557fce2 commit b3d34e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/gitlabHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class GitlabHelper {
116116
*/
117117
async getAttachment(relurl: string) {
118118
try {
119-
const attachmentUrl = this.host + '/' + this.projectPath + relurl;
119+
const attachmentUrl = this.host + '/-/project/' + this.gitlabProjectId + relurl;
120120
const data = (
121121
await axios.get(attachmentUrl, {
122122
responseType: 'arraybuffer',
@@ -129,7 +129,7 @@ export class GitlabHelper {
129129
).data;
130130
return Buffer.from(data, 'binary');
131131
} catch (err) {
132-
console.error(`Could not download attachment #${relurl}.`);
132+
console.error(`Could not download attachment #${relurl}: ${err.response.statusText}`);
133133
return null;
134134
}
135135
}

0 commit comments

Comments
 (0)