openapi-explorer 2.2.721 → 2.2.722

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,7 +21,11 @@ export default async function ProcessSpec(specUrlOrObject, serverUrl = '') {
21
21
  }
22
22
  if (!jsonParsedSpec) {
23
23
  if (errorToDisplay) {
24
- throw Error(`Failed to resolve the spec: ${errorToDisplay}`);
24
+ if (inputSpecIsAUrl && specUrlOrObject.toString().match('localhost')) {
25
+ throw Error(`Cannot connect to your localhost running spec because your webserver is blocking requests. To the load the spec from ${specUrlOrObject.toString()}, return the following CORS header \`"Access-Control-Allow-Private-Network": "true"\`.`);
26
+ }
27
+ const message = `Failed to resolve the spec: ${errorToDisplay}`;
28
+ throw Error(message);
25
29
  }
26
30
  throw Error('SpecificationNotFound');
27
31
  }
@@ -27,7 +27,11 @@ async function ProcessSpec(specUrlOrObject, serverUrl = '') {
27
27
  }
28
28
  if (!jsonParsedSpec) {
29
29
  if (errorToDisplay) {
30
- throw Error(`Failed to resolve the spec: ${errorToDisplay}`);
30
+ if (inputSpecIsAUrl && specUrlOrObject.toString().match('localhost')) {
31
+ throw Error(`Cannot connect to your localhost running spec because your webserver is blocking requests. To the load the spec from ${specUrlOrObject.toString()}, return the following CORS header \`"Access-Control-Allow-Private-Network": "true"\`.`);
32
+ }
33
+ const message = `Failed to resolve the spec: ${errorToDisplay}`;
34
+ throw Error(message);
31
35
  }
32
36
  throw Error('SpecificationNotFound');
33
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-explorer",
3
- "version": "2.2.721",
3
+ "version": "2.2.722",
4
4
  "description": "OpenAPI Explorer - API viewer with dynamically generated components, documentation, and interaction console",
5
5
  "author": "Authress Developers <developers@authress.io>",
6
6
  "type": "module",