tanhakabir / rest-book

REST Book is a Visual Studio Code extension that allows you to perform REST calls in a Notebook interface.
https://marketplace.visualstudio.com/items?itemName=tanhakabir.rest-book
MIT License
249 stars 24 forks source link

Including `User-Agent` header causes infinite loop when process.env.NODE_ENV is undefined #119

Open linhub15 opened 3 years ago

linhub15 commented 3 years ago

Possible infinite loop.

When User-Agent header is specified and process.env.NODE_ENV is undefined we hit line 273 and continue the while loop without ever incrementing the index i++

https://github.com/tanhakabir/rest-book/blob/6df707bf0ef7f4b81f6ce73b7308952e39a2a065/src/common/request.ts#L266-L278

Tested on VS Code

Version: 1.61.2
Commit: 6cba118ac49a1b88332f312a8f67186f7f3c1643
Date: 2021-10-19T14:58:13.605Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.4.0-89-generic