Fix CSP rule preventing inline CSS

This commit is contained in:
Christian Bundy 2019-11-12 20:24:19 -08:00
parent d80665b6e3
commit 4adba8b7ee
No known key found for this signature in database
GPG Key ID: EB541AAEF4366237
2 changed files with 13 additions and 10 deletions

View File

@ -58,7 +58,7 @@ module.exports = (config) => {
'img-src \'self\'',
'form-action \'self\'',
'media-src \'self\'',
'style-src \'self\''
'style-src \'self\' \'unsafe-inline\''
].join('; ')
// Disallow scripts.

View File

@ -1,15 +1,17 @@
'use strict'
const lodash = require('lodash')
const pull = require('pull-stream')
const prettyMs = require('pretty-ms')
const { isRoot, isNestedReply, isReply } = require('ssb-thread-schema')
const debug = require('debug')('oasis:model-post')
const lodash = require('lodash')
const parallelMap = require('pull-paramap')
const prettyMs = require('pretty-ms')
const pull = require('pull-stream')
const { isRoot, isReply } = require('ssb-thread-schema')
// HACK: https://github.com/ssbc/ssb-thread-schema/issues/4
const isNestedReply = require('ssb-thread-schema/post/nested-reply/validator')
const cooler = require('./lib/cooler')
const configure = require('./lib/configure')
const cooler = require('./lib/cooler')
const markdown = require('./lib/markdown')
const maxMessages = 128
@ -336,6 +338,7 @@ const post = {
}
if (msg.value.content.type !== 'post') {
debug('not a post')
resolve(msg)
}
@ -375,7 +378,8 @@ const post = {
} else {
// type !== "post", probably
// this should show up as JSON
debug('got mysterious root ancestor')
debug('got mysterious root ancestor that fails all known schemas')
debug('%O', msg)
resolve(msg)
}
}
@ -540,8 +544,7 @@ const post = {
const myFeedId = whoami.id
const options = configure({
type: 'post',
private: true
type: 'post'
}, customOptions)
const source = await cooler.read(