Skip to content

Commit

Permalink
Bypass ngsw-worker for update requests
Browse files Browse the repository at this point in the history
  • Loading branch information
eceeeren committed Nov 12, 2024
1 parent ee583f9 commit ad63c98
Show file tree
Hide file tree
Showing 2 changed files with 8 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 @@ -54,8 +54,11 @@ export class AttachmentService {
const options = createRequestOption(req);
const copy = this.convertAttachmentDatesFromClient(attachment);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ export class AttachmentUnitService {
}

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

0 comments on commit ad63c98

Please sign in to comment.