@evanp/activitypub-bot 0.28.5 → 0.28.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/app.js CHANGED
@@ -177,6 +177,7 @@ export async function makeApp ({ databaseUrl, origin, bots, logLevel = 'silent',
177
177
  }))
178
178
 
179
179
  app.use(express.json({
180
+ limit: '1mb',
180
181
  type: [
181
182
  'application/activity+json',
182
183
  'application/ld+json',
@@ -176,11 +176,13 @@ export class HTTPSignature {
176
176
  }
177
177
 
178
178
  #parseSignatureHeader (signature) {
179
- const parts = signature.split(',')
179
+ const parts = signature.match(/\w+="[^"]*"/g)
180
180
  const params = {}
181
181
  for (const part of parts) {
182
- const [key, value] = part.split('=')
183
- params[key] = value.replace(/"/g, '')
182
+ const eq = part.indexOf('=')
183
+ const key = part.slice(0, eq)
184
+ const value = part.slice(eq + 2, -1)
185
+ params[key] = value
184
186
  }
185
187
  return params
186
188
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evanp/activitypub-bot",
3
- "version": "0.28.5",
3
+ "version": "0.28.7",
4
4
  "description": "server-side ActivityPub bot framework",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",