Alibrown commited on
Commit
ab2d3bc
·
verified ·
1 Parent(s): 3a31d83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py CHANGED
@@ -23,6 +23,20 @@ def proxy_pac():
23
  mimetype='application/x-ns-proxy-autoconfig'
24
  )
25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  if __name__ == "__main__":
27
  # Werkzeug Logger auch deaktivieren
28
  import logging
 
23
  mimetype='application/x-ns-proxy-autoconfig'
24
  )
25
 
26
+ @app.route('/<path:url>', methods=['GET', 'POST', 'PUT', 'DELETE'])
27
+ def proxy(url):
28
+ try:
29
+ response = requests.request(
30
+ method=request.method,
31
+ url=url,
32
+ headers={key: value for (key, value) in request.headers if key != 'Host'},
33
+ data=request.get_data(),
34
+ allow_redirects=False
35
+ )
36
+ return Response(response.content, response.status_code)
37
+ except:
38
+ return Response("Error", 500)
39
+
40
  if __name__ == "__main__":
41
  # Werkzeug Logger auch deaktivieren
42
  import logging