Getting 403 when upload image to WAF webapp
Robert Lucena
5
Reputation points
I'm trying to send a post request to a webapp hosted on azure using WAF and I'm getting a 403 for all requests with files. This is the code that I'm using:
public insertForm(endpoint: string, model: INews, file: File): Observable {
let fileToUpload = file;
const headers = new HttpHeaders().set('Content-Type', 'multipart/form-data');
const formData = new FormData();
formData.append('file', fileToUpload, fileToUpload.name);
formData.append('News', JSON.stringify(model));
var path = `${environment.apiUrl}` + endpoint;
return this.http.post(path, formData, {}).pipe(
catchError((error: HttpErrorResponse) => this.instanceHandleError.handleError(error))
);;
}
Any idea about what is wrong?
Sign in to answer