mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 14:38:47 +00:00
handle proxy methods other than GET
This commit is contained in:
parent
bc2025b3ba
commit
53149df5f1
2 changed files with 4 additions and 1 deletions
|
@ -11,6 +11,7 @@ export default async function credentialedProxyHandler(req, res) {
|
||||||
if (widget) {
|
if (widget) {
|
||||||
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
|
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
|
||||||
const [status, contentType, data] = await httpProxy(url, {
|
const [status, contentType, data] = await httpProxy(url, {
|
||||||
|
method: req.method,
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
@ -10,7 +10,9 @@ export default async function genericProxyHandler(req, res) {
|
||||||
|
|
||||||
if (widget) {
|
if (widget) {
|
||||||
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
|
const url = new URL(formatApiCall(widget.type, { endpoint, ...widget }));
|
||||||
const [status, contentType, data] = await httpProxy(url);
|
const [status, contentType, data] = await httpProxy(url, {
|
||||||
|
method: req.method,
|
||||||
|
});
|
||||||
|
|
||||||
if (contentType) res.setHeader("Content-Type", contentType);
|
if (contentType) res.setHeader("Content-Type", contentType);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue