title: Flasgger / Swagger - apidocs works with localhost but not Openshift (You need to enable JavaScript to run this app)
body: <p>I am running a Python Flask server. A co-worker added Flasgger/Swagger support and I can successfully display the API using</p>
  <pre><code>http://localhost:5000/apidocs
  </code></pre>
  <p>Similarly, I can get the json version of the API</p>
  <pre><code>http://localhost:5000/api_documentation.json
    Python code configures that filename
  </code></pre>
  <p>That same code is deployed in an Openshift project and uses Traefik to route external requests to the Python Flask server</p>
  <pre><code>https://my-openshift-url-here/apidocs
    does not display the API
    only displays &quot;Powered by Flasgger 0.9.5
  https://my-openshift-url-here/api_documentation.json
    works same as the localhost request
  </code></pre>
  <p>Traefik keys off of the &quot;apidocs&quot; and &quot;api_documentation.json&quot; and routes it directly to the Python Flask server</p>
  <pre><code>        rule: PathPrefix(`/apidocs`)
          entryPoints:
            - web
          middlewares:
            - gzip
            - mysecurity-no-token
          service: my-python-server
  
        apidocumentation:
          rule: PathPrefix(`/api_documentation.json`)
          entryPoints:
            - web
          middlewares:
            - gzip
            - mysecurity-no-token
          service: my-python-server
  
  </code></pre>
  <p>What I see in my Chrome browser debugger (F12 - Network) for the swagger-ui-bundle.js response is &quot;You need to enable JavaScript to run this app.&quot;</p>
  <p>Why does this work in Chrome for the <em>localhost</em> version but not when accessing the server deployed on <em>Openshift</em>? Both are being accessed from the same Chrome window - just different tabs.</p>
  <p>This is the Headers content of the apidocs request for the localhost version</p>
  <pre><code>    Request Method: GET
      Status Code: 200 OK
      Remote Address: 127.0.0.1:5000
      Referrer Policy: strict-origin-when-cross-origin
      Content-Length: 3041
      Content-Type: text/html; charset=utf-8
      Date: Thu, 19 Aug 2021 12:08:41 GMT
      Server: Werkzeug/2.0.1 Python/3.7.4
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
      Accept-Encoding: gzip, deflate, br
      Accept-Language: en-US,en;q=0.9
      Cache-Control: no-cache
      Connection: keep-alive
      Host: localhost:5000
      Pragma: no-cache
      sec-ch-ua: &quot;Chromium&quot;;v=&quot;92&quot;, &quot; Not A;Brand&quot;;v=&quot;99&quot;, &quot;Google Chrome&quot;;v=&quot;92&quot;
      sec-ch-ua-mobile: ?0
      Sec-Fetch-Dest: document
      Sec-Fetch-Mode: navigate
      Sec-Fetch-Site: none
      Sec-Fetch-User: ?1
      Upgrade-Insecure-Requests: 1
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
  </code></pre>
  <p>This is the Headers content of the apidocs request for the Openshift version</p>
  <pre><code>    Request Method: GET
      Status Code: 200 OK
      Remote Address: 123.456.789.123:443 (obfuscated, of course)
      Referrer Policy: origin
      content-encoding: gzip
      content-length: 1264
      content-type: text/html; charset=utf-8
      date: Thu, 19 Aug 2021 12:08:59 GMT
      server: istio-envoy
      vary: Accept-Encoding
      x-envoy-upstream-service-time: 28
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
      Accept-Encoding: gzip, deflate, br
      Accept-Language: en-US,en;q=0.9
      Cache-Control: no-cache
      Connection: keep-alive
      Host: my-openshift-server-url-here
      Pragma: no-cache
      sec-ch-ua: &quot;Chromium&quot;;v=&quot;92&quot;, &quot; Not A;Brand&quot;;v=&quot;99&quot;, &quot;Google Chrome&quot;;v=&quot;92&quot;
      sec-ch-ua-mobile: ?0
      Sec-Fetch-Dest: document
      Sec-Fetch-Mode: navigate
      Sec-Fetch-Site: none
      Sec-Fetch-User: ?1
      Upgrade-Insecure-Requests: 1
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
  </code></pre>