Skip to content

Commit be2cf6d

Browse files
authored
Merge pull request #700 from saschagrunert/cors-fix
Modify release notes link to the allowed CDN
2 parents 0ecdf3c + 49bd868 commit be2cf6d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/app/notes/notes.service.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,12 @@ export class NotesService {
103103
* @returns Transformed URL
104104
*/
105105
private cdnLinkFromGsPath(path: string): string {
106+
const allowedCorsLink = 'cdn.dl.k8s.io';
106107
// Normalize the link if required
107-
const regex = /^gs:\/\/[\w-/.]*\.json$/;
108-
if (path.match(regex)) {
109-
return path.replace(/^gs:\/\/[\w-]*\//, 'https://cdn.dl.k8s.io/');
108+
if (path.match(/^gs:\/\/[\w-/.]*\.json$/)) {
109+
return path.replace(/^gs:\/\/[\w-]*\//, `https://${allowedCorsLink}/`);
110110
}
111-
return path;
111+
112+
return path.replace(/dl\.k8s\.io/, allowedCorsLink);
112113
}
113114
}

0 commit comments

Comments
 (0)