@@ -50,16 +50,25 @@ def get_snark_conn():
5050 },
5151 "host" : BaseConfig .SWAGGER_HOST , # overrides localhost:500
5252 "basePath" : "/uptimescore" , # base bash for blueprint registration
53- "schemes" : ["https" , "http" ],
53+ "schemes" : ["https" , "http" ],
5454 "operationId" : "uptimescore" ,
5555}
5656
57+ swagger_config = Swagger .DEFAULT_CONFIG
58+ swagger_config ["swagger_ui_bundle_js" ] = (
59+ "//unpkg.com/[email protected] /swagger-ui-bundle.js" 60+ )
61+ swagger_config ["swagger_ui_standalone_preset_js" ] = (
62+ "//unpkg.com/[email protected] /swagger-ui-standalone-preset.js" 63+ )
64+ swagger_config [
"jquery_js" ]
= "//unpkg.com/[email protected] /dist/jquery.min.js" 65+ swagger_config [
"swagger_ui_css" ]
= "//unpkg.com/[email protected] /swagger-ui.css" 5766
5867# create app instance
5968app = Flask (__name__ )
6069app .config .from_mapping (config )
6170cache = Cache (app )
62- swagger = Swagger (app , template = template )
71+ swagger = Swagger (app , template = template , config = swagger_config )
6372
6473
6574# 1
@@ -285,5 +294,15 @@ def handle_exception(e):
285294 return jsonify (response ), 500
286295
287296
297+ @app .before_request
298+ def disallow_all_get_params ():
299+ if request .args :
300+ response = {
301+ "error" : "Query parameters are not allowed" ,
302+ "error_message" : "This application does not support query parameters in requests." ,
303+ }
304+ return jsonify (response ), 400
305+
306+
288307if __name__ == "__main__" :
289308 app .run (host = BaseConfig .API_HOST , port = BaseConfig .API_PORT , debug = BaseConfig .DEBUG )
0 commit comments