mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-18 10:50:32 +03:00
fix: crash when $ref is url encoded
reported by @mikunn
This commit is contained in:
parent
343f51a867
commit
bdf60794f3
|
@ -82,7 +82,7 @@
|
||||||
"json-schema-ref-parser": "^3.3.1",
|
"json-schema-ref-parser": "^3.3.1",
|
||||||
"mobx": "^3.3.0",
|
"mobx": "^3.3.0",
|
||||||
"mobx-react": "^4.3.3",
|
"mobx-react": "^4.3.3",
|
||||||
"openapi-sampler": "^1.0.0-beta.1",
|
"openapi-sampler": "1.0.0-beta.8",
|
||||||
"prismjs": "^1.8.1",
|
"prismjs": "^1.8.1",
|
||||||
"prop-types": "^15.6.0",
|
"prop-types": "^15.6.0",
|
||||||
"react-dropdown": "^1.3.0",
|
"react-dropdown": "^1.3.0",
|
||||||
|
|
|
@ -89,6 +89,7 @@ export class OpenAPIParser {
|
||||||
let res;
|
let res;
|
||||||
if (this.spec === undefined) return;
|
if (this.spec === undefined) return;
|
||||||
if (ref.charAt(0) !== '#') ref = '#' + ref;
|
if (ref.charAt(0) !== '#') ref = '#' + ref;
|
||||||
|
ref = decodeURI(ref);
|
||||||
try {
|
try {
|
||||||
res = JsonPointer.get(this.spec, decodeURIComponent(ref));
|
res = JsonPointer.get(this.spec, decodeURIComponent(ref));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -4670,9 +4670,9 @@ ono@^4.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
format-util "^1.0.3"
|
format-util "^1.0.3"
|
||||||
|
|
||||||
openapi-sampler@^1.0.0-beta.1:
|
openapi-sampler@1.0.0-beta.8:
|
||||||
version "1.0.0-beta.7"
|
version "1.0.0-beta.8"
|
||||||
resolved "https://registry.yarnpkg.com/openapi-sampler/-/openapi-sampler-1.0.0-beta.7.tgz#4932a3994067af86f95cb912ee56d01123e27d88"
|
resolved "https://registry.yarnpkg.com/openapi-sampler/-/openapi-sampler-1.0.0-beta.8.tgz#bf43ff47737fc4e1f988d0e2082d49788f41dead"
|
||||||
dependencies:
|
dependencies:
|
||||||
json-pointer "^0.6.0"
|
json-pointer "^0.6.0"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user