Fix: non-english broken plugins (#701)
* fix epiknovel * fix: hasutl * fix: Novelas Ligera * fix: ReinoWuxia * fix: Oasis * fix: json script * fix: Skynovels * fix: Yuuki Tls * fix: Agitoon * fix: Syosetu * fix: IndoWebNovel * fix: Novel Ringan * fix: Sakura Novel * fix: Hako * minor: type checking when PRing
This commit is contained in:
@@ -20,6 +20,13 @@ export const getHeaders = () => {
|
||||
app.use((req, res, next) => {
|
||||
const xHeaders = req.headers["x-custom-headers"];
|
||||
if (xHeaders && typeof xHeaders === "string") {
|
||||
for (const [headerName, headerValue] of Object.entries(pluginApi.fetchHeaders)) {
|
||||
if (
|
||||
typeof headerName === "string" &&
|
||||
typeof headerValue === "string"
|
||||
)
|
||||
delete pluginApi.fetchHeaders[headerName];
|
||||
}
|
||||
const headers = JSON.parse(xHeaders);
|
||||
for (const [headerName, headerValue] of Object.entries(headers)) {
|
||||
if (
|
||||
@@ -80,7 +87,7 @@ app.post("/fetchImage/", async (req, res) => {
|
||||
req.body["pluginRequirePath"],
|
||||
req.body["url"]
|
||||
);
|
||||
res.json(base64);
|
||||
res.send(base64);
|
||||
});
|
||||
|
||||
app.get("/", (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user