send icon indicating copy to clipboard operation
send copied to clipboard

Set the first parameter of the setHeaders option to Koa Response

Open YSMJ1994 opened this issue 6 years ago • 2 comments

I think most people are used to using " Koa Response" in koa or not "Node Response". Just like use ctx.response.set('Cache-Control', 'max-age=0') or not ctx.res.setHeader(...). Because Koa officially states Bypassing Koa's response handling is not supported

YSMJ1994 avatar Jan 12 '20 08:01 YSMJ1994

This is also a problem for me;

if (!ctx.response.get('Cache-Control')) ctx.set('Cache-Control', 'max-age=' + (maxage / 1000 | 0));

I need to make sure there are no Cache-Control headers that will collide with Akamai but this currently can't be controlled with an options flag

denniskenny avatar Jan 28 '21 17:01 denniskenny

staticServe(__dirname + "/public", { setHeadears: function (res, path, stats) { res.setHeader("Cache-Control", "max-age=60"); }, })

I want to ask why this is not effective?

thor-baijing avatar Apr 23 '21 03:04 thor-baijing