예제 #1
0
파일: sidecar.py 프로젝트: akleiw/KSP
	def call(self, request, device):
		q = query_params(request.body_text())
		if is_uuid(q.get('key'), q.get('type')):
			logging.warn("sharing annotations for Calibre books is not supported")
			return 200

		return self.call_upstream(request, device)
예제 #2
0
파일: request.py 프로젝트: MSylvia/KSP
def get_query_params(req):
	_, _, query = req.path.partition('?')
	if query:
		return query_params(query)
	q = {}
	if is_signed(req) and req.command == 'POST' and req.body and req.headers['Content-Type'] == 'text/xml':
		try:
			with minidom.parseString(req.body) as doc:
				x_request = qxml.get_child(doc, 'request')
				x_parameters = qxml.get_child(x_request, 'parameters')
				for p in qxml.list_children(x_parameters):
					q[p.nodeName] = qxml.get_text(p)
		except: pass
	return q
예제 #3
0
def get_query_params(req):
    _, _, query = req.path.partition('?')
    if query:
        return query_params(query)
    q = {}
    if is_signed(req) and req.command == 'POST' and req.body and req.headers[
            'Content-Type'] == 'text/xml':
        try:
            with minidom.parseString(req.body) as doc:
                x_request = qxml.get_child(doc, 'request')
                x_parameters = qxml.get_child(x_request, 'parameters')
                for p in qxml.list_children(x_parameters):
                    q[p.nodeName] = qxml.get_text(p)
        except:
            pass
    return q