Open Antosser opened 8 months ago
This design is on purpose.
You can use NodeJS Http Server as example: https://www.npmjs.com/package/http-server.
In basic authentication, you use two inputs to build credentials for simplicity and at the same time flexibilty.
Any assumptions makes by app designer/developer would reflect on limitations.
Alright! Haven't really looked into the standards. What do you think about throwing an error if only one of them is passed in?
Alright! Haven't really looked into the standards. What do you think about throwing an error if only one of them is passed in?
No worries! I agree with that! That validation is actually missing!
Right now,
--username
and--password
are separate arguments that don't work without each other. Why not combine them into a single password? You can only have one username, so what's the point of even having them? If anyone wants, they can use a colon to separate the username and password. Also, no error is thrown if you only pass in one of them, which is confusing and actually tripped me up for a second a couple of months ago