'Can't parse the token along with special characters like (+) we get from URL params in Nodejs
I'm getting automatically generated token along with url like mentioned below:
https://localhost:3000/?token=ebkfJu12VQpfwX3YwAMo7PZoGYJftaMisMcL6VeNSz8IUmaywH64U2k6l8KFCblWXZfPbd9oJSshcwo/6p6cPrMtifFOXfduJbKTeitJqpIwAsq4CpaagGHdZpluUlDSsVlS2KoYQBS/XqxTcSLq+iS4wUWNpKYH8z7w9Vzs7AYPOZEFixSIslP9amBZWtTSIOi/NZkNheYJPRLHun6gHGRZTBAgp8y/6jPvCyjS8HCgqscEqhNponeGoazJAVZuxE1syphiv4EBkjigLIbDl2IoN77shBWwEgojmvmo8UuhV8WhnziXQQrdJU1nirjgCIJ84jxn5d+fjqQC0xfSJQ==
Since this token contains +, hence at the time of parsing const params = new URLSearchParams(tokenString); + is replaced by spaces. How to get the token untouched?
The output I am expecting is
{
token: 'ebkfJu12VQpfwX3YwAMo7PZoGYJftaMisMcL6VeNSz8IUmaywH64U2k6l8KFCblWXZfPbd9oJSshcwo/6p6cPrMtifFOXfduJbKTeitJqpIwAsq4CpaagGHdZpluUlDSsVlS2KoYQBS/XqxTcSLq+iS4wUWNpKYH8z7w9Vzs7AYPOZEFixSIslP9amBZWtTSIOi/NZkNheYJPRLHun6gHGRZTBAgp8y/6jPvCyjS8HCgqscEqhNponeGoazJAVZuxE1syphiv4EBkjigLIbDl2IoN77shBWwEgojmvmo8UuhV8WhnziXQQrdJU1nirjgCIJ84jxn5d+fjqQC0xfSJQ=='
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
