Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Add v3.42.7
Browse files Browse the repository at this point in the history
  • Loading branch information
YannickRe committed Nov 3, 2021
1 parent 483be25 commit d5baa8b
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 29 deletions.

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion core/server/api/canary/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ module.exports = {
enableDeveloperExperiments: config.get('enableDeveloperExperiments') || false,
stripeDirect: config.get('stripeDirect'),
mailgunIsConfigured: config.get('bulkEmail') && config.get('bulkEmail').mailgun,
emailAnalytics: config.get('emailAnalytics')
emailAnalytics: config.get('emailAnalytics'),
forceUpgrade: config.get('host_settings:forceUpgrade') || false
};
if (billingUrl) {
response.billingUrl = billingUrl;
Expand Down
3 changes: 2 additions & 1 deletion core/server/api/v3/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ module.exports = {
enableDeveloperExperiments: config.get('enableDeveloperExperiments') || false,
stripeDirect: config.get('stripeDirect'),
mailgunIsConfigured: config.get('bulkEmail') && config.get('bulkEmail').mailgun,
emailAnalytics: config.get('emailAnalytics')
emailAnalytics: config.get('emailAnalytics'),
forceUpgrade: config.get('host_settings:forceUpgrade') || false
};
if (billingUrl) {
response.billingUrl = billingUrl;
Expand Down
11 changes: 11 additions & 0 deletions core/server/web/admin/controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const debug = require('ghost-ignition').debug('web:admin:controller');
const path = require('path');
const fs = require('fs');
const crypto = require('crypto');
const config = require('../../../shared/config');
const updateCheck = require('../../update-check');
const logging = require('../../../shared/logging');
Expand All @@ -25,6 +27,15 @@ module.exports = function adminController(req, res) {
const templatePath = path.resolve(config.get('paths').adminViews, defaultTemplate);
const headers = {};

// Generate our own ETag header
// `sendFile` by default uses filesize+lastmod date to generate an etag.
// That doesn't work for admin templates because the filesize doesn't change between versions
// and `npm pack` sets a fixed lastmod date for every file meaning the default etag never changes
const fileBuffer = fs.readFileSync(templatePath);
const hashSum = crypto.createHash('md5');
hashSum.update(fileBuffer);
headers.ETag = hashSum.digest('hex');

if (config.get('adminFrameProtection')) {
headers['X-Frame-Options'] = 'sameorigin';
}
Expand Down
2 changes: 1 addition & 1 deletion core/server/web/admin/views/default-prod.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@


<script src="assets/vendor.min-1ea21c7abed44258b1662cf1b103c007.js"></script>
<script src="assets/ghost.min-fc6277154fa6217cd103de2019eb4352.js"></script>
<script src="assets/ghost.min-c2286c1da1671730ae28b70205449d2f.js"></script>

</body>
</html>
2 changes: 1 addition & 1 deletion core/server/web/admin/views/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@


<script src="assets/vendor.min-1ea21c7abed44258b1662cf1b103c007.js"></script>
<script src="assets/ghost.min-fc6277154fa6217cd103de2019eb4352.js"></script>
<script src="assets/ghost.min-c2286c1da1671730ae28b70205449d2f.js"></script>

</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ghost",
"version": "3.42.6",
"version": "3.42.7",
"description": "The professional publishing platform",
"author": "Ghost Foundation",
"homepage": "https://ghost.org",
Expand Down

0 comments on commit d5baa8b

Please sign in to comment.