Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #501 from AVGP/release-3.1.0
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
AVGP authored Nov 4, 2020
2 parents 50036a4 + daea270 commit c74e81e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rendertron",
"version": "3.0.0",
"version": "3.1.0",
"description": "Renders webpages using headless Chrome for usage by bots",
"license": "Apache-2.0",
"repository": "https://github.com/GoogleChrome/rendertron",
Expand Down Expand Up @@ -55,6 +55,6 @@
"nodemon": "^2.0.6",
"supertest": "^6.0.1",
"tslint": "^6.1.3",
"typescript": "~4.0.5"
"typescript": "4.0.5"
}
}
7 changes: 1 addition & 6 deletions src/rendertron.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ export class Rendertron {
return;
}

let options = undefined;
if (ctx.method === 'POST' && ctx.request.body) {
options = ctx.request.body;
}

const dimensions = {
width: Number(ctx.query['width']) || this.config.width,
height: Number(ctx.query['height']) || this.config.height
Expand All @@ -166,7 +161,7 @@ export class Rendertron {

try {
const img = await this.renderer.screenshot(
url, mobileVersion, dimensions, options, ctx.query.timezoneId);
url, mobileVersion, dimensions, ctx.query.timezoneId);

for (const key in this.config.headers) {
ctx.set(key, this.config.headers[key]);
Expand Down
2 changes: 1 addition & 1 deletion src/test/app-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ test('renders shadow DOM - webcomponents-lite.js polyfill', async (t: ExecutionC
});

test('script tags and link[rel=import] tags are stripped', async (t: ExecutionContext) => {
const res = await server.get(`/render/${testBase}include-script.html`);
const res = await server.get(`/render/${testBase}include-script.html?wc-inject-polyfills=true`);
t.is(res.status, 200);
t.false(res.text.indexOf('script src') !== -1);
t.true(res.text.indexOf('injectedElement') !== -1);
Expand Down

0 comments on commit c74e81e

Please sign in to comment.