Search code examples
expresshttp-proxyhttp2

i am using http2 with express , getting error "Cannot set deprecated header: connection"


I am using http2 and express in my application. and using http-proxy to proxy requests to other APIs. when i hit an proxy API in express, i am getting "Cannot set deprecated header: connection". It seems http-proxy adds connection header automatically which is deprecated. I tried with "request" instead of http-proxy, still the same error.


Solution

  • It was http-proxy's issue. http-proxy tries to write connection header which is not allowed in http2 causing error.