Monday 28 August 2023
HTML form won't submit (Angular)
Saturday 6 May 2023
Why won't my Angular app include cookies in a POST request?
Recently while working on an Angular web app operating with CORS on localhost against a SpringBoot server I had an issue where my GET requests were fine, but the POST requests (in this case for logout) did not include a cookie. At first I though I had some kind of problem with my CORS config - but this was fine:
var corsConfig = new CorsConfiguration();
corsConfig.setAllowedOriginPatterns(List.of(
"http://localhost:4200",
"http://localhost:8080"));
corsConfig.applyPermitDefaultValues();
corsConfig.setAllowCredentials(true);
It turns out the signature for the POST request use by Angular is slightly different! The second argument is actually for a body. So in my case:
return this.http.post<void>(this.logoutUrl, null, {withCredentials: true});
This might help someone who is starting to question their understanding of CORS (again)
HTML form won't submit (Angular)
It turns out if you mix normal HTML forms with Angular ones (i.e. using FormsModule) Angular will disable the default behaviour of forms on...
-
I've recently installed AIPS (version 31DEC16) on Ubuntu 16.04. Here are my notes on the installation experience. Due to recent compiler...
-
Scientific computing and HPC developers will probably be familiar with Intel's C/C++ compiler suite , which can be used to compile...
-
AWS recently went live with Keyspaces, their managed version of Cassandra ( https://aws.amazon.com/keyspaces/ ). This service is primarily a...