def GET(self, brief_or_full, idtype, idval): i = web.input() web.ctx.headers = [] req = '%s:%s' % (idtype, idval) result = readlinks.readlinks(req, i) if req in result: result = result[req] else: result = [] return simplejson.dumps(result)
def GET(self, brief_or_full, req): # params aren't used, see below i = web.input() # Work around issue with gunicorn where semicolon and after # get truncated. (web.input() still seems ok) # see https://github.com/benoitc/gunicorn/issues/215 raw_uri = web.ctx.env.get("RAW_URI") raw_path = urlparse.urlsplit(raw_uri).path # handle e.g. '%7C' for '|' decoded_path = urllib2.unquote(raw_path) m = self.path_re.match(decoded_path) if not len(m.groups()) == 2: return simplejson.dumps({}) (brief_or_full, req) = m.groups() web.ctx.headers = [] result = readlinks.readlinks(req, i) return simplejson.dumps(result)