koltyakov / sp-rest-proxy

🌐 SharePoint API Proxy for local development
MIT License
172 stars 43 forks source link

Can this proxy be used when the host SP environment (on prem) has a "strict-origin-when-cross-origin" HTTP referrer policy? #142

Open samperrow opened 2 years ago

samperrow commented 2 years ago

I have tried connecting to an on-premise SP environment with those safeguards, but I haven't been able to successfully make HTTP requests via this proxy service.

koltyakov commented 2 years ago

Hey @samperrow,

Do you have an idea how I could configure on-prem instance with strict-origin to verify if it works?

Could you check are you able consuming SharePoint API via sp-request. If it worked I guess I can manage a referrer to workaround the policy.

samperrow commented 2 years ago

@koltyakov I do not know how you could configure an on-prem SP instance to test this unfortunately.. And I wasn't able to get this working with sp-request, so maybe there is no work-around that is readily available.

davea38 commented 1 year ago

@samperrow in short you can do this but you need to have some middleware that changes the origin of the host header to match the target URL. For express http-proxy-middleware has this functionality in its createProxyMiddleware method.