We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0ecdf3c + 49bd868 commit be2cf6dCopy full SHA for be2cf6d
src/app/notes/notes.service.ts
@@ -103,11 +103,12 @@ export class NotesService {
103
* @returns Transformed URL
104
*/
105
private cdnLinkFromGsPath(path: string): string {
106
+ const allowedCorsLink = 'cdn.dl.k8s.io';
107
// Normalize the link if required
- const regex = /^gs:\/\/[\w-/.]*\.json$/;
108
- if (path.match(regex)) {
109
- return path.replace(/^gs:\/\/[\w-]*\//, 'https://cdn.dl.k8s.io/');
+ if (path.match(/^gs:\/\/[\w-/.]*\.json$/)) {
+ return path.replace(/^gs:\/\/[\w-]*\//, `https://${allowedCorsLink}/`);
110
}
111
- return path;
+
112
+ return path.replace(/dl\.k8s\.io/, allowedCorsLink);
113
114
0 commit comments