Skip to content

Commit

Permalink
fix(console): make etag / if-match work with angular & angularJs
Browse files Browse the repository at this point in the history
(cherry picked from commit 2b55015)
  • Loading branch information
ThibaudAV committed Sep 27, 2024
1 parent 601303d commit 420657f
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,23 @@ export class IfMatchEtagInterceptor implements HttpInterceptor {

private urlToKeyMatchers: ((url: string) => string | undefined)[] = [
(url) => {
const matchArray = url.match(new RegExp(`/management/organizations/(.*)/environments/(.*)/apis/(.*)`));
const matchArray = url.match(new RegExp(`/management/organizations/([^\\/]+)/environments/([^\\/]+)/apis/([^\\/]+)`));
if (matchArray) {
return `api-${matchArray[3]}`;
}
},
(url) => {
const matchArray = url.match(new RegExp(`/management/v2/environments/(.*)/apis/(.*)`));
const matchArray = url.match(new RegExp(`/management/v2/environments/([^\\/]+)/apis/([^\\/]+)`));
if (matchArray) {
return `api-${matchArray[2]}`;
}
},
(url) => {
const matchArray = url.match(new RegExp(`/management/v2/organizations/([^\\/]+)/environments/([^\\/]+)/apis/([^\\/]+)`));
if (matchArray) {
return `api-${matchArray[3]}`;
}
},
];
public lastEtag: Record<string, string> = {};

Expand Down

0 comments on commit 420657f

Please sign in to comment.