From 3f6e21e3b17a8dd015e45724fbbf471445d7c5c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sat, 14 Apr 2018 03:02:36 +0300 Subject: [PATCH] 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 --- src/core/plugins/oas3/components/http-auth.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/plugins/oas3/components/http-auth.jsx b/src/core/plugins/oas3/components/http-auth.jsx index 9750f2dd..5e991b49 100644 --- a/src/core/plugins/oas3/components/http-auth.jsx +++ b/src/core/plugins/oas3/components/http-auth.jsx @@ -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
- {name} HTTP authentication: unsupported or missing scheme + {name} HTTP authentication: unsupported scheme {`'${scheme}'`}
} }