I have an old Angular site that is making an API call to my .Net Framework API.
Angular:
return this.http.post<User>( this.apiUrl +'directory/user',{'AuthTicket': authTicket } ).pipe( map(result => {...
This causes an OPTIONS request followed by a POST.
We made some changes to a completely different part of the API and deployed those changes. Now when the request is made, the OPTIONS request will fail and the POST request never hits the web logs.
I opened up Fiddler to see what was being passed and all the sudden everything works! After much digging, I finally added as much as I could to the web logs and discovered that the first requests that fail, they are making the request using HTTP/2. Once I turn on Fiddler, the requests are made using HTTP/1.1. Even after turning Fiddler off, it still continues to use HTTP/1.1 because the successful OPTIONS request is cached.
I've been thinking this was a CORS issue, until I saw the above with the HTTP protocol differences. The sites are running on the same server. They use a common domain with different subdomains, i.e. angular.domain.com and api.domain.com.
The errors I see in Chrome Tools are :net::ERR_HTTP2_PROTOCOL_ERRORandHttpErrorResponse {headers: HttpHeaders, status: 0, statusText: 'Unknown Error', url: 'https://<>/directory/user', ok: false, …}
I'm stuck on what to do here. Any direction you could point me in would be greatly appreciated!