def normalize_post_query(self): if self.method != 'POST': return if not self.wb_url: return mime = self.env.get('CONTENT_TYPE').split(';')[0] length = self.env.get('CONTENT_LENGTH') stream = self.env['wsgi.input'] post_query = extract_post_query('POST', mime, length, stream) if post_query: self.wb_url.url = append_post_query(self.wb_url.url, post_query)
def normalize_post_query(self): if self.method != 'POST': return if not self.wb_url: return mime = self.env.get('CONTENT_TYPE', '').split(';')[0] length = self.env.get('CONTENT_LENGTH') stream = self.env['wsgi.input'] post_query = extract_post_query('POST', mime, length, stream) if post_query: self.wb_url.url = append_post_query(self.wb_url.url, post_query)
def normalize_post_query(self): if self.method != 'POST': return if not self.wb_url: return mime = self.env.get('CONTENT_TYPE', '') length = self.env.get('CONTENT_LENGTH') stream = self.env['wsgi.input'] buffered_stream = BytesIO() post_query = extract_post_query('POST', mime, length, stream, buffered_stream=buffered_stream, environ=self.env) if post_query: self.env['wsgi.input'] = buffered_stream self.wb_url.url = append_post_query(self.wb_url.url, post_query)
def include_post_query(self, url): if not url or self.get_req_method() != 'POST': return url mime = self._get_content_type() #mime = mime.split(';')[0] if mime else '' length = self._get_content_length() stream = self.env['wsgi.input'] buffered_stream = BytesIO() post_query = extract_post_query('POST', mime, length, stream, buffered_stream=buffered_stream, environ=self.env) if post_query: self.env['wsgi.input'] = buffered_stream url = append_post_query(url, post_query) return url
def merge_request_data(self, other, options): surt_ordered = options.get('surt_ordered', True) if other.record.rec_type != 'request': return False # two requests, not correct if self.record.rec_type == 'request': return False # merge POST/PUT body query if hasattr(other, 'post_query'): url = append_post_query(self.url, other.post_query) self.key = canonicalize(url, surt_ordered) other.key = self.key referer = other.record.status_headers.get_header('referer') if referer: self.referer = referer return True
def merge_request_data(self, other, options): surt_ordered = options.get('surt_ordered', True) if other.record.rec_type != 'request': return False # two requests, not correct if self.record.rec_type == 'request': return False # merge POST/PUT body query post_query = other.get('_post_query') if post_query: url = append_post_query(self['url'], post_query) self['urlkey'] = canonicalize(url, surt_ordered) other['urlkey'] = self['urlkey'] referer = other.record.status_headers.get_header('referer') if referer: self['_referer'] = referer return True