Skip to content

Commit db0fe87

Browse files
yhwangyingsu00
authored andcommitted
Add bootstrap icon to the vendor folder
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]>
1 parent 9c4b683 commit db0fe87

File tree

14 files changed

+17
-20
lines changed

14 files changed

+17
-20
lines changed

presto-main/src/main/java/com/facebook/presto/server/CoordinatorModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ protected void setup(Binder binder)
144144
{
145145
httpServerBinder(binder).bindResource("/ui", "webapp").withWelcomeFile("index.html")
146146
.withExtraHeader(HttpHeaders.X_CONTENT_TYPE_OPTIONS, "nosniff")
147-
.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'");
147+
.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:");
148148
httpServerBinder(binder).bindResource("/tableau", "webapp/tableau")
149149
.withExtraHeader(HttpHeaders.X_CONTENT_TYPE_OPTIONS, "nosniff")
150-
.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'");
150+
.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:");
151151

152152
// discovery server
153153
install(installModuleIf(EmbeddedDiscoveryConfig.class, EmbeddedDiscoveryConfig::isEnabled, new EmbeddedDiscoveryModule()));

presto-ui/src/static/dev/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

1414
<!-- Bootstrap core -->
1515
<link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">

presto-ui/src/static/embedded_plan.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
1414

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

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

presto-ui/src/static/index.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

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

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

30-
31-
32-
<script type="text/javascript" >
33-
jQuery.htmlPrefilter = function( html ) {
34-
return html;
35-
};
36-
</script>
37-
3830
<!-- CSS loader -->
3931
<link href="vendor/css-loaders/loader.css" rel="stylesheet">
4032

presto-ui/src/static/plan.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
1414

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

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

presto-ui/src/static/query.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
1414

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

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

presto-ui/src/static/res_groups.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
1414

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

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

presto-ui/src/static/sql_client.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
1414

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

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

presto-ui/src/static/stage.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
1414

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

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

presto-ui/src/static/timeline.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
1414

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

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

0 commit comments

Comments
 (0)