-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Open
Labels
Description
Q | A |
---|---|
Bug or feature request? | Bug |
Which Swagger/OpenAPI version? | 2.0 |
Which Swagger-UI version? | 3.9.0 |
How did you install Swagger-UI? | loading via cdnjs |
Which browser & version? | Chrome 63.0.3239.132 |
Which operating system? | Windows |
Expected Behavior
Clicking the spec link will show the spec
Current Behavior
Instead it links to about:blank. Testing the operations and everything else works, the link worked in 3.0.18
The issue can also be reproduced on the petstore,
Possible Solution
The url is sanitized via
swagger-ui/src/core/components/info.jsx
Line 101 in 1b5c060
{ url && <a target="_blank" href={ sanitizeUrl(url) }><span className="url"> { url } </span></a> } |
which calls
https://github.com/braintree/sanitize-url/blob/master/index.js
but the relative url does not contain ":" so the regex fails and the link becomes "about:blank"
Context
Workaround is to just copy/paste the spec url into the browser address