Edit response headers before piping

mscdex’s answer did work for me, but I found a way that I think is slightly cleaner. In my original code, I had this line:

req.pipe(newReq).pipe(res);

I replaced that with these lines:

req.pipe(newReq).on('response', function(res) {
    delete res.headers['user-agent'];
    // ...
}).pipe(res);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)