improve: HTTP auth display logic and messaging (#4430)

* http-auth: Include unsupported scheme name in error message

* http-auth: Treat authentication scheme case insensitively

The spec refers to RFC 7235 for scheme names, and the RFC says names
are matched case insensitively.

* linter fixes
This commit is contained in:
Ville Skyttä
2018-04-14 03:02:36 +03:00
committed by kyle
parent 26d0ad7684
commit 3f6e21e3b1

View File

@@ -53,7 +53,7 @@ export default class HttpAuth extends React.Component {
const Markdown = getComponent( "Markdown" )
const JumpToPath = getComponent("JumpToPath", true)
const scheme = schema.get("scheme")
const scheme = (schema.get("scheme") || "").toLowerCase()
let value = this.getValue()
let errors = errSelectors.allErrors().filter( err => err.get("authId") === name)
@@ -125,7 +125,7 @@ export default class HttpAuth extends React.Component {
)
}
return <div>
<em><b>{name}</b> HTTP authentication: unsupported or missing scheme</em>
<em><b>{name}</b> HTTP authentication: unsupported scheme {`'${scheme}'`}</em>
</div>
}
}