Allow form data through without JSON header

This commit is contained in:
Matthew Ross 2020-05-11 19:09:24 -04:00
parent f28ab24634
commit 5748f762e9

View File

@ -21,9 +21,9 @@ export class ApiInterceptor implements HttpInterceptor {
constructor(private router: Router) {}
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
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) {