App-Netdisco

 view release on metacpan or  search on metacpan

share/public/swagger-ui/index.html  view on Meta::CPAN

<!-- HTML for static distribution bundle build -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Swagger UI</title>
    <link rel="stylesheet" type="text/css" href="./swagger-ui.css" >
    <link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
    <link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
    <style>
      html
      {
        box-sizing: border-box;
        overflow: -moz-scrollbars-vertical;
        overflow-y: scroll;
      }

      *,
      *:before,
      *:after
      {
        box-sizing: inherit;
      }

      body
      {
        margin:0;
        background: #fafafa;
      }
    </style>
  </head>

  <body>
    <div id="swagger-ui"></div>

    <script src="./swagger-ui-bundle.js"> </script>
    <script src="./swagger-ui-standalone-preset.js"> </script>
    <script>
    window.onload = function() {
      // Swagger UI 4.1.3 and later ignore ?url= unless queryConfigEnabled is
      // set, and that switch also re-enables configUrl and every other query
      // key. Netdisco only needs the one parameter, which Web.pm builds with
      // uri_for so it carries any path prefix, so read it here instead.
      //
      // Resolve the candidate and compare origins rather than matching the
      // string. Pattern matching is not sufficient: for http and https the URL
      // parser treats a backslash as a path separator, so "/\evil.com/x.json"
      // looks relative and resolves to another origin.
      //
      // The path is pinned as well, because same origin alone would accept any
      // JSON an attacker could get served from this host. Web.pm only ever
      // builds uri_for('/swagger.json'), and a path-prefixed deployment still
      // ends in /swagger.json.
      //
      // Returning the path rather than resolved.href keeps the topbar URL field
      // reading "/swagger.json" as it did before this upgrade.
      function sameOriginSpecUrl(candidate) {
        if (!candidate) return null;
        var resolved;
        try {
          resolved = new URL(candidate, window.location.href);
        }
        catch (e) {
          return null;
        }
        if (resolved.origin !== window.location.origin) return null;
        if (!resolved.pathname.endsWith('/swagger.json')) return null;
        return resolved.pathname + resolved.search;
      }



( run in 0.842 second using v1.01-cache-2.11-cpan-788537b7465 )