@paywalls-net/filter 1.2.3 → 1.2.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +10 -8
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Client SDK for integrating paywalls.net bot filtering and authorization services into your server or CDN.",
4
4
  "author": "paywalls.net",
5
5
  "license": "MIT",
6
- "version": "1.2.3",
6
+ "version": "1.2.4",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
package/src/index.js CHANGED
@@ -275,15 +275,17 @@ async function cloudflare(config = null) {
275
275
  }
276
276
 
277
277
 
278
- async function fastly(config) {
279
- const paywallsConfig = {
280
- paywallsAPIHost: config.get('PAYWALLS_CLOUD_API_HOST') || PAYWALLS_CLOUD_API_HOST,
281
- paywallsAPIKey: config.get('PAYWALLS_API_KEY'),
282
- paywallsPublisherId: config.get('PAYWALLS_PUBLISHER_ID')
283
- };
284
- await loadAgentPatterns(paywallsConfig);
278
+ async function fastly() {
279
+
280
+ return async function handle(request, config, ctx) {
281
+ const paywallsConfig = {
282
+ paywallsAPIHost: config.get('PAYWALLS_CLOUD_API_HOST') || PAYWALLS_CLOUD_API_HOST,
283
+ paywallsAPIKey: config.get('PAYWALLS_API_KEY'),
284
+ paywallsPublisherId: config.get('PAYWALLS_PUBLISHER_ID')
285
+ };
286
+
287
+ await loadAgentPatterns(paywallsConfig);
285
288
 
286
- return async function handle(request) {
287
289
  if (await isRecognizedBot(paywallsConfig, request)) {
288
290
  const authz = await checkAgentStatus(paywallsConfig, request);
289
291