on 12-Jan-201514:30 - edited on 05-Jun-202313:37 by JimmyPackets
Here's a couple rapid-fire snippets to help you manipulate HTTP request URI's. The first converts all characters in a URI to lowercase before submitting the request to the backend server. Node.js (and javascript) provide some very helpful string manipulation methods -
toLowerCase()
is one.
In the second snippet, we're using a simple regex check and string concatenation to ensure that any URI has a trailing forward slash before being passed to the backend server.