7

I've created a simple express app to test redirection of headers.

Unfortunately, the header get dismissed after redirection.

When I request /justheader2 using postman with some X-Header it works.

I hope someone could figure it out.

enter image description here

enter image description here

enter image description here

Amin Taghikhani
  • 684
  • 1
  • 8
  • 22
Noray
  • 165
  • 2
  • 6

1 Answers1

0

A redirection in the HTTP protocol doesn't support adding any headers to the target location. It's basically just a header in itself and only allows for a URL.

When you adding your X-Header header with res.header you are sending that header back to the client.

Amin Taghikhani
  • 684
  • 1
  • 8
  • 22