From 5748f762e93468ebebd84ede9e551eea8062179c Mon Sep 17 00:00:00 2001 From: Matthew Ross Date: Mon, 11 May 2020 19:09:24 -0400 Subject: [PATCH] Allow form data through without JSON header --- src/app/app.api-http.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/app.api-http.ts b/src/app/app.api-http.ts index 514c31e..d002b26 100644 --- a/src/app/app.api-http.ts +++ b/src/app/app.api-http.ts @@ -21,9 +21,9 @@ export class ApiInterceptor implements HttpInterceptor { constructor(private router: Router) {} intercept(request: HttpRequest, next: HttpHandler): Observable> { - const headers = { - 'Content-Type': 'application/json' - }; + const headers = (request.body instanceof FormData) + ? { } + : { 'Content-Type': 'application/json' }; const token = sessionStorage.getItem(this.JWT_KEY); if (token !== null) {