The one-liner node.js proxy middleware for connect, express, next.js and more
92
Pending
Does it follow best practices?
Impact
92%
1.24xAverage score across 10 eval scenarios
Pending
The risk profile of this skill
Build a proxy middleware service that forwards requests to a backend API and ensures that cookies returned from the backend can be properly set in the browser, regardless of domain differences.
Create a proxy middleware that:
/api/* to a backend serverThe solution should handle:
Set-Cookie headerSet-Cookie headers (as an array)Domain= attributes that need to be removedSet-Cookie: session=abc123; Domain=backend.com; Path=/, when proxied, the domain attribute should be removed resulting in Set-Cookie: session=abc123; Path=/ @testSet-Cookie: token=xyz789; Path=/; HttpOnly (no domain), when proxied, the cookie should remain unchanged @test@generates
/**
* Creates a proxy middleware that forwards requests and removes domain
* attributes from response cookies.
*
* @param {object} options - Configuration options
* @param {string} options.target - The backend server URL to proxy requests to
* @returns {Function} Express/Connect middleware function
*/
function createCookieProxy(options) {
// Implementation here
}
module.exports = { createCookieProxy };Provides HTTP proxy middleware functionality with response interception support.
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10