From f3984b198db10dc4f6a2d87f6c35a9677fcb274d Mon Sep 17 00:00:00 2001 From: "dr.dimitru" Date: Tue, 3 Nov 2020 00:06:14 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=A6=20v1.6.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 👨‍💻 Add `nel` and `report-to` to ignored headers - 👨‍💻 Improve HTTP response headers RegExp. Closing #6; Thanks to @arabidopsis for suggestion 👍 - ✨ Add support for `debug` option - 👷 Internal codebase micro-refactoring - 📋 Minor docs update --- .versions | 18 +++++++++--------- README.md | 14 +++++++++++--- lib/index.js | 2 +- package-lock.json | 2 +- package.js | 2 +- package.json | 2 +- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.versions b/.versions index ed8e8de..6ef061e 100644 --- a/.versions +++ b/.versions @@ -3,26 +3,26 @@ babel-compiler@7.5.3 babel-runtime@1.5.0 base64@1.0.12 binary-heap@1.0.11 -boilerplate-generator@1.7.0 +boilerplate-generator@1.7.1 callback-hook@1.3.0 check@1.3.1 ddp@1.4.0 ddp-client@2.3.3 ddp-common@1.4.0 -ddp-server@2.3.1 +ddp-server@2.3.2 diff-sequence@1.1.1 dynamic-import@0.5.2 ecmascript@0.14.3 ecmascript-runtime@0.7.0 -ecmascript-runtime-client@0.10.0 -ecmascript-runtime-server@0.9.0 +ecmascript-runtime-client@0.11.0 +ecmascript-runtime-server@0.10.0 ejson@1.1.1 fetch@0.1.1 geojson-utils@1.0.10 http@1.4.2 id-map@1.1.0 inter-process-messaging@0.1.1 -local-test:ostrio:spiderable-middleware@1.6.1 +local-test:ostrio:spiderable-middleware@1.6.2 logging@1.1.20 meteor@1.9.3 minimongo@1.6.0 @@ -33,18 +33,18 @@ mongo@1.10.0 mongo-decimal@0.1.1 mongo-dev-server@1.1.0 mongo-id@1.0.7 -npm-mongo@3.7.0 +npm-mongo@3.8.1 ordered-dict@1.1.0 -ostrio:spiderable-middleware@1.6.1 +ostrio:spiderable-middleware@1.6.2 promise@0.11.2 random@1.2.0 reload@1.3.0 retry@1.1.0 routepolicy@1.1.0 -socket-stream-client@0.3.0 +socket-stream-client@0.3.1 tinytest@1.1.0 tracker@1.2.0 underscore@1.0.10 -url@1.3.0 +url@1.3.1 webapp@1.9.1 webapp-hashing@1.0.9 diff --git a/README.md b/README.md index ba0d743..59fbe32 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ Google, Facebook, Twitter, Yahoo, and Bing and all other crawlers and search eng - 📱 Support for mobile-like crawlers; - 💅 Support [`styled-components`](https://styled-components.com); - ⚡️ Support [AMP (Accelerated Mobile Pages)](https://www.ampproject.org); +- 🤓 Works with `Content-Security-Policy` and other "complicated" front-end security; - ❤️ Search engines and social network crawlers love straightforward and pre-rendered pages; - 📱 Consistent link previews in messaging apps, like iMessage, Messages, Facebook, Slack, Telegram, WhatsApp, Viber, VK, Twitter, etc.; - 💻 Image, title, and description previews for posted links at social networks, like Facebook, Twitter, VK and others. @@ -60,6 +61,8 @@ This package was originally developed for [ostr.io](https://ostr.io) service. Bu ## Installation +This package is distributed via NPM for Node.js and Atmosphere for Meteor.js. Although it is safe to use NPM distributed version in Meteor backend. + ### NPM: ```shell @@ -73,7 +76,12 @@ meteor add webapp meteor add ostrio:spiderable-middleware ``` -## Basic usage + +## Usage + +Get ready in a few lines of code + +### Basic usage See [all examples](https://github.com/VeliovGroup/spiderable-middleware/tree/master/examples). @@ -110,9 +118,9 @@ app.use(spiderable.handler).get('/', (req, res) => { app.listen(3000); ``` -We provide various options for `serviceURL` as "[Rendering Endpoints](https://github.com/VeliovGroup/ostrio/blob/master/docs/prerendering/rendering-endpoints.md)", each has its own features, to fit every project needs. +We provide various options for `serviceURL` as "[Rendering Endpoints](https://github.com/VeliovGroup/ostrio/blob/master/docs/prerendering/rendering-endpoints.md)", each endpoint has its own features to fit every project needs. -## Meteor specific usage +### Meteor specific usage ```js // Install necessary packages: diff --git a/lib/index.js b/lib/index.js index e9ef7f5..7bb9f2a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -35,7 +35,7 @@ var _warn = function warn (...args) { }; request.defaultOptions.debug = false; -request.defaultOptions.headers = { 'User-Agent': 'spiderable-middleware/1.6.1', Accept: '*/*' }; +request.defaultOptions.headers = { 'User-Agent': 'spiderable-middleware/1.6.2', Accept: '*/*' }; request.defaultOptions.noStorage = true; request.defaultOptions.rawBody = true; request.defaultOptions.retry = true; diff --git a/package-lock.json b/package-lock.json index dc34bf1..bb445c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "spiderable-middleware", - "version": "1.6.1", + "version": "1.6.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.js b/package.js index 7463632..357873a 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'ostrio:spiderable-middleware', - version: '1.6.1', + version: '1.6.2', summary: 'Allow JavaScript websites to be perfectly crawled and indexed by search engines (SEO)', git: 'https://github.com/VeliovGroup/spiderable-middleware', documentation: 'README.md' diff --git a/package.json b/package.json index 0e60258..2d986d1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spiderable-middleware", - "version": "1.6.1", + "version": "1.6.2", "description": "Perfect SEO for JavaScript websites. Pre-rendering — it's just like SSR with simple integration and no coding", "main": "./lib/index.js", "scripts": {