Skip to content

Commit

Permalink
Add bootstrap icon to the vendor folder
Browse files Browse the repository at this point in the history
Since the CSP style-src is enforced, need to serve the bootstrap
icon locally as well. Add the CSS/font files to vendor/bootstrap.
Also update the CSP header to include the proper `img-src` directive.

Signed-off-by: Yihong Wang <[email protected]>
  • Loading branch information
yhwang authored and yingsu00 committed Feb 18, 2025
1 parent 9c4b683 commit db0fe87
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ protected void setup(Binder binder)
{
httpServerBinder(binder).bindResource("/ui", "webapp").withWelcomeFile("index.html")
.withExtraHeader(HttpHeaders.X_CONTENT_TYPE_OPTIONS, "nosniff")
.withExtraHeader(HttpHeaders.CONTENT_SECURITY_POLICY, "default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; frame-ancestors 'self'");
.withExtraHeader(HttpHeaders.CONTENT_SECURITY_POLICY, "default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; frame-ancestors 'self'; img-src http: https: data:");
httpServerBinder(binder).bindResource("/tableau", "webapp/tableau")
.withExtraHeader(HttpHeaders.X_CONTENT_TYPE_OPTIONS, "nosniff")
.withExtraHeader(HttpHeaders.CONTENT_SECURITY_POLICY, "default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; frame-ancestors 'self'");
.withExtraHeader(HttpHeaders.CONTENT_SECURITY_POLICY, "default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; frame-ancestors 'self'; img-src http: https: data:");

// discovery server
install(installModuleIf(EmbeddedDiscoveryConfig.class, EmbeddedDiscoveryConfig::isEnabled, new EmbeddedDiscoveryModule()));
Expand Down
2 changes: 1 addition & 1 deletion presto-ui/src/static/dev/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<link rel="icon" href="../assets/favicon.ico">
<!-- Link for btn checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="../vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- Bootstrap core -->
<link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
Expand Down
2 changes: 1 addition & 1 deletion presto-ui/src/static/embedded_plan.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Link for icons checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand Down
10 changes: 1 addition & 9 deletions presto-ui/src/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<link rel="icon" href="assets/favicon.ico">
<!-- Link for btn checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- Bootstrap core -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
Expand All @@ -27,14 +27,6 @@
<!-- Bootstrap JS -->
<script type="text/javascript" src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>



<script type="text/javascript" >
jQuery.htmlPrefilter = function( html ) {
return html;
};
</script>

<!-- CSS loader -->
<link href="vendor/css-loaders/loader.css" rel="stylesheet">

Expand Down
2 changes: 1 addition & 1 deletion presto-ui/src/static/plan.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Link for icons checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion presto-ui/src/static/query.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Link for icons checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion presto-ui/src/static/res_groups.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Link for icons checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion presto-ui/src/static/sql_client.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Link for icons checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion presto-ui/src/static/stage.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Link for icons checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand Down
2 changes: 1 addition & 1 deletion presto-ui/src/static/timeline.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Link for icons checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand Down

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion presto-ui/src/static/worker.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

<!-- Link for icons checkmark-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap[email protected]/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap-icons.min.css">

<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
Expand Down

0 comments on commit db0fe87

Please sign in to comment.