I am trying to set CORS rules on my Azure Blob Storage account by following these instructions.
This is the error I receive after making my request:
Following what @jsgoupil said:
For people reaching this page and wondering why you get this error even though you are using a Shared Access Signature URL, then you most likely are sending YOUR APP token to Azure. Make sure to NOT include the Authorization header in this case.
In case you have an interceptor you can add a skip to a request by following the instructions on this stackOverflow post: https://stackoverflow.com/a/49047764/5232022
export const InterceptorSkipHeader = 'X-Skip-Interceptor'; // <-- ADD THIS
@Injectable()
export class SkippableInterceptor implements HttpInterceptor {
intercept(req: HttpRequest, next: HttpHandler): Observable> {
// Add the following if to your interceptor
if (req.headers.has(InterceptorSkipHeader)) {
const headers = req.headers.delete(InterceptorSkipHeader);
return next.handle(req.clone({ headers }));
}
... // intercept
}
}
Then whenever you want to skip the interception for a particular request:
const headers = new HttpHeaders().set(InterceptorSkipHeader, ''); // <-- this will skip it
this.httpClient.get(someUrl, { headers }) // <-- dont forget to add it here as well