Skip to content

Commit

Permalink
Add ngsw-bypass as a header
Browse files Browse the repository at this point in the history
  • Loading branch information
eceeeren committed Nov 12, 2024
1 parent 7876792 commit ee583f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/webapp/app/lecture/attachment.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ export class AttachmentService {
copy.lecture.posts = undefined;
}

/** Ngsw-worker is bypassed temporarily to fix Chromium file upload issue
* See: https://issues.chromium.org/issues/374550348
**/
return this.http
.post<Attachment>(this.resourceUrl, this.createFormData(copy, file), { observe: 'response' })
.post<Attachment>(this.resourceUrl, this.createFormData(copy, file), { headers: { 'ngsw-bypass': 'true' }, observe: 'response' })
.pipe(map((res: EntityResponseType) => this.convertAttachmentResponseDatesFromServer(res)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ export class AttachmentUnitService {
}

create(formData: FormData, lectureId: number): Observable<EntityResponseType> {
/** Ngsw-worker is bypassed temporarily to fix Chromium file upload issue
* See: https://issues.chromium.org/issues/374550348
**/
return this.httpClient
.post<AttachmentUnit>(`${this.resourceURL}/lectures/${lectureId}/attachment-units?keepFilename=true`, formData, { observe: 'response' })
.post<AttachmentUnit>(`${this.resourceURL}/lectures/${lectureId}/attachment-units?keepFilename=true`, formData, {
headers: { 'ngsw-bypass': 'true' },
observe: 'response',
})
.pipe(map((res: EntityResponseType) => this.lectureUnitService.convertLectureUnitResponseDatesFromServer(res)));
}

Expand Down

0 comments on commit ee583f9

Please sign in to comment.