mirror of
https://github.com/QuiteAFancyEmerald/Holy-Unblocker.git
synced 2025-05-13 03:50:02 -04:00
Added Corrosion Fix for Heroku
Credits: https://github.com/BinBashBanana/Corrosion-Heroku (very epic person)
This commit is contained in:
parent
8d88daf1c2
commit
b0c48df26c
25 changed files with 13 additions and 10 deletions
32
lib/rewrite.js
Normal file
32
lib/rewrite.js
Normal file
|
@ -0,0 +1,32 @@
|
|||
// -------------------------------------------------------------
|
||||
// WARNING: this file is used by both the client and the server.
|
||||
// Do not use any browser or node-specific API!
|
||||
// -------------------------------------------------------------
|
||||
const URLWrapper = require('./url');
|
||||
const CookieRewriter = require('./cookie');
|
||||
const CSSRewriter = require('./css');
|
||||
const HTMLRewriter = require('./html');
|
||||
const JSRewriter = require('./js');
|
||||
const defaultConfig = {
|
||||
prefix: '/service/',
|
||||
codec: 'plain',
|
||||
ws: true,
|
||||
cookie: true,
|
||||
title: 'Service',
|
||||
};
|
||||
|
||||
class Rewrite {
|
||||
constructor(config = defaultConfig) {
|
||||
this.config = Object.assign(defaultConfig, config);
|
||||
this.prefix = this.config.prefix;
|
||||
this.forceHttps = this.config.forceHttps;
|
||||
this.url = new URLWrapper(this.config || {});
|
||||
this.codec = this.url.codec;
|
||||
this.cookies = new CookieRewriter(this);
|
||||
this.css = new CSSRewriter(this);
|
||||
this.js = new JSRewriter(this);
|
||||
this.html = new HTMLRewriter(this);
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = Rewrite;
|
Loading…
Add table
Add a link
Reference in a new issue