Skip to content
Snippets Groups Projects
Commit 58b17b45 authored by Rolf Niepraschk's avatar Rolf Niepraschk
Browse files

missing query string

parent ca958fdd
No related branches found
No related tags found
No related merge requests found
from flask import Flask, Response, redirect, url_for, request, \
send_from_directory
from flask import Flask, Response, request, send_from_directory
from flask_cors import CORS
import requests, json
import re
......@@ -48,6 +47,7 @@ def lib(fn):
## from: http://host/5984/foo/bar
## to: http://127.0.0.1:5984/foo/bar
## ------------------------------------
# TODO: evtl besser make_response(...)?
def couchdb_proxy_1(path):
new_url = '{}://{}:{}/{}'.format(COUCHDB_PROTO, COUCHDB_HOST, \
COUCHDB_PORT, path)
......@@ -71,8 +71,13 @@ def couchdb_proxy_1(path):
@app.route('/{}/<path:path>'.format(COUCHDB_PORT),
methods=['GET','PUSH','POST','DELETE'])
def couchdb_proxy(path=''):
app.logger.debug('original request: ' + request.url)
return couchdb_proxy_1(path);
app.logger.debug('original request: ' + request.url)
q = request.query_string.decode();
if q:
p = path + '?' + q
else:
p = path
return couchdb_proxy_1(p);
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8080)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment