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:
nyagami
2024-01-20 21:20:28 +07:00
committed by GitHub
parent ba718784a5
commit 65ae9ba112
45 changed files with 5606 additions and 1998 deletions
+8 -1
View File
@@ -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) => {