Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Fix the default-csp setting to conform to the spec: Use the default CSP if the setting is an empty string. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
6b5606d8321c396e9a1fae769ead698d |
| User & Date: | drh 2024-07-29 12:19:51.576 |
Context
|
2024-07-29
| ||
| 12:45 | Add the glob_multi_match() interface that allows checking against a comma-separated list of GLOB patterns without having to compile the list first. ... (check-in: dc86831179 user: drh tags: trunk) | |
| 12:19 | Fix the default-csp setting to conform to the spec: Use the default CSP if the setting is an empty string. ... (check-in: 6b5606d832 user: drh tags: trunk) | |
| 11:58 | Previous check-in does not work. Change it so that the backoffice is not even attempted if the database is in read-only mode. ... (check-in: 503354d1ca user: drh tags: trunk) | |
Changes
Changes to src/style.c.
| ︙ | ︙ | |||
82 83 84 85 86 87 88 | static unsigned adUnitFlags = 0; /* ** Submenu disable flag */ static int submenuEnable = 1; | < < < < < < | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | static unsigned adUnitFlags = 0; /* ** Submenu disable flag */ static int submenuEnable = 1; /* ** Flags for various javascript files needed prior to </body> */ static int needHrefJs = 0; /* href.js */ /* ** Extra JS added to the end of the file. |
| ︙ | ︙ | |||
606 607 608 609 610 611 612 | "style-src 'self' 'unsafe-inline'; " "img-src * data:"; const char *zFormat; Blob csp; char *zNonce; char *zCsp; int i; | < | < < < < < < < < < < < | 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 |
"style-src 'self' 'unsafe-inline'; "
"img-src * data:";
const char *zFormat;
Blob csp;
char *zNonce;
char *zCsp;
int i;
zFormat = db_get("default-csp",0);
if( zFormat==0 || zFormat[0]==0 ){
zFormat = zBackupCSP;
}
blob_init(&csp, 0, 0);
while( zFormat[0] && (zNonce = strstr(zFormat,"$nonce"))!=0 ){
blob_append(&csp, zFormat, (int)(zNonce - zFormat));
blob_append(&csp, style_nonce(), -1);
zFormat = zNonce + 6;
}
blob_append(&csp, zFormat, -1);
zCsp = blob_str(&csp);
/* No whitespace other than actual space characters allowed in the CSP
** string. See https://fossil-scm.org/forum/forumpost/d29e3af43c */
for(i=0; zCsp[i]; i++){ if( fossil_isspace(zCsp[i]) ) zCsp[i] = ' '; }
if( toHeader ){
cgi_printf_header("Content-Security-Policy: %s\r\n", zCsp);
}
return zCsp;
}
/*
** Default HTML page header text through <body>. If the repository-specific
** header template lacks a <body> tag, then all of the following is
** prepended.
*/
static const char zDfltHeader[] =
@ <html>
|
| ︙ | ︙ |