Skip to content

Commit d3952ed

Browse files
Thomas Cauquiljoeferner
authored andcommitted
Fix: Buffer deprecated
1 parent 31851ee commit d3952ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/modifyGoogle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ proxy.onRequest((ctx, callback) => {
1818
ctx.use(Proxy.gunzip);
1919

2020
ctx.onResponseData((ctx, chunk, callback) => {
21-
chunk = new Buffer(
21+
chunk = Buffer.from(
2222
chunk.toString().replace(/<h3.*?<\/h3>/g, "<h3>Pwned!</h3>")
2323
);
2424
return callback(null, chunk);

0 commit comments

Comments
 (0)