mirror of
https://github.com/kennethreitz/httpbin.git
synced 2026-06-05 23:00:18 +00:00
Merge pull request #485 from steffenschroeder/master
Fixed #484 by correcting templates
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
FROM ubuntu:18.04
|
||||
|
||||
LABEL name="httpbin"
|
||||
LABEL version="0.9.1"
|
||||
LABEL version="0.9.2"
|
||||
LABEL description="A simple HTTP service."
|
||||
LABEL org.kennethreitz.vendor="Kenneth Reitz"
|
||||
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
0.9.1
|
||||
0.9.2
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
<hgroup class="main">
|
||||
<h2 class="title">httpbin.org
|
||||
<small>
|
||||
<pre class="version">0.9.1</pre>
|
||||
<pre class="version">0.9.2</pre>
|
||||
</small>
|
||||
</h2>
|
||||
<pre class="base-url">[ Base URL: httpbin.org/ ]</pre>
|
||||
@@ -137,14 +137,14 @@
|
||||
|
||||
<script src="{{url_for('flasgger.static', filename='swagger-ui-bundle.js')}}"> </script>
|
||||
<script src="{{url_for('flasgger.static', filename='swagger-ui-standalone-preset.js')}}"> </script>
|
||||
<script src='{{url_for(' flasgger.static ', filename=' ')}}lib/jquery.min.js' type='text/javascript'></script>
|
||||
<script src='{{url_for('flasgger.static', filename=' ')}}lib/jquery.min.js' type='text/javascript'></script>
|
||||
<script>
|
||||
|
||||
window.onload = function () {
|
||||
{% if config.JWT_AUTH_URL_RULE -%}
|
||||
{% if config.JWT_AUTH_URL_RULE %}
|
||||
// JWT token holder
|
||||
var jwt_token;
|
||||
{% - endif %}
|
||||
{% endif %}
|
||||
|
||||
fetch("{{ specs[0]['url'] }}")
|
||||
.then(function (response) {
|
||||
@@ -177,7 +177,7 @@
|
||||
plugins: [
|
||||
SwaggerUIBundle.plugins.DownloadUrl
|
||||
],
|
||||
{% if config.JWT_AUTH_URL_RULE -%}
|
||||
{% if config.JWT_AUTH_URL_RULE %}
|
||||
requestInterceptor: function (request) {
|
||||
if (jwt_token) {
|
||||
request.headers.Authorization = "Bearer " + jwt_token;
|
||||
@@ -195,7 +195,7 @@
|
||||
|
||||
return response;
|
||||
},
|
||||
{% - endif %}
|
||||
{% endif %}
|
||||
// layout: "StandaloneLayout" // uncomment to enable the green top header
|
||||
})
|
||||
|
||||
|
||||
@@ -114,6 +114,10 @@ class HttpbinTestCase(unittest.TestCase):
|
||||
httpbin.app.debug = True
|
||||
self.app = httpbin.app.test_client()
|
||||
|
||||
def test_index(self):
|
||||
response = self.app.get('/', headers={'User-Agent': 'test'})
|
||||
self.assertEqual(response.status_code, 200)
|
||||
|
||||
def get_data(self, response):
|
||||
if 'get_data' in dir(response):
|
||||
return response.get_data()
|
||||
|
||||
Reference in New Issue
Block a user