LionC / express-basic-auth

Plug & play basic auth middleware for express
325 stars 57 forks source link

Add the UTF-8 `charset` `auth-param`. #52

Open issuefiler opened 1 year ago

issuefiler commented 1 year ago

https://github.com/LionC/express-basic-auth/blob/dd17b4de9fee9558269cdc583310bde5331456e7/index.js#L66-L75

Now that UTF-8 has become the de facto universal standard, I suggest adding the UTF-8 charset auth-param defined by RFC 7617, to the WWW-Authenticate header field value express-basic-auth produces.

WWW-Authenticate: Basic realm="real", charset="UTF-8"
issuefiler commented 1 year ago

The comparison is already being performed in UTF-8.

https://github.com/LionC/express-basic-auth/blob/dd17b4de9fee9558269cdc583310bde5331456e7/index.js#L7-L17

LionC commented 9 months ago

Will have to check if this change is 100% downwards compatible. Definitely a good suggestion, thank you!