The simplest HTTP proxy with custom headers

These days I had an interesting problem to solve. At work, on our staging environment, we have basic authorization. It works really well but for some older versions of Chrome we experienced a weird issue. The browser did not pass the authorization header. The app runs fine but as soon as it does a fetch request to a local endpoint the request fails with 401 not-authorized error. In the modern browsers that’s not happening because the browser kinda knows that we came here with basic auth and automatically includes authorization: basic ... header.


This content originally appeared on Krasimir Tsonev - blog and was authored by Krasimir Tsonev - blog

These days I had an interesting problem to solve. At work, on our staging environment, we have basic authorization. It works really well but for some older versions of Chrome we experienced a weird issue. The browser did not pass the authorization header. The app runs fine but as soon as it does a fetch request to a local endpoint the request fails with 401 not-authorized error. In the modern browsers that's not happening because the browser kinda knows that we came here with basic auth and automatically includes authorization: basic ... header.


This content originally appeared on Krasimir Tsonev - blog and was authored by Krasimir Tsonev - blog


Print Share Comment Cite Upload Translate
APA
Krasimir Tsonev - blog | Sciencx (2023-01-29T06:43:19+00:00) » The simplest HTTP proxy with custom headers. Retrieved from https://www.scien.cx/2021/02/07/the-simplest-http-proxy-with-custom-headers/.
MLA
" » The simplest HTTP proxy with custom headers." Krasimir Tsonev - blog | Sciencx - Sunday February 7, 2021, https://www.scien.cx/2021/02/07/the-simplest-http-proxy-with-custom-headers/
HARVARD
Krasimir Tsonev - blog | Sciencx Sunday February 7, 2021 » The simplest HTTP proxy with custom headers., viewed 2023-01-29T06:43:19+00:00,<https://www.scien.cx/2021/02/07/the-simplest-http-proxy-with-custom-headers/>
VANCOUVER
Krasimir Tsonev - blog | Sciencx - » The simplest HTTP proxy with custom headers. [Internet]. [Accessed 2023-01-29T06:43:19+00:00]. Available from: https://www.scien.cx/2021/02/07/the-simplest-http-proxy-with-custom-headers/
CHICAGO
" » The simplest HTTP proxy with custom headers." Krasimir Tsonev - blog | Sciencx - Accessed 2023-01-29T06:43:19+00:00. https://www.scien.cx/2021/02/07/the-simplest-http-proxy-with-custom-headers/
IEEE
" » The simplest HTTP proxy with custom headers." Krasimir Tsonev - blog | Sciencx [Online]. Available: https://www.scien.cx/2021/02/07/the-simplest-http-proxy-with-custom-headers/. [Accessed: 2023-01-29T06:43:19+00:00]
rf:citation
» The simplest HTTP proxy with custom headers | Krasimir Tsonev - blog | Sciencx | https://www.scien.cx/2021/02/07/the-simplest-http-proxy-with-custom-headers/ | 2023-01-29T06:43:19+00:00
https://github.com/addpipe/simple-recorderjs-demo