~alisonken1/openlp/strings-core-ui

« back to all changes in this revision

Viewing changes to openlp/plugins/remotes/lib/httprouter.py

  • Committer: Tim Bentley
  • Date: 2016-05-19 06:00:35 UTC
  • mfrom: (2661.1.5 mayfixes)
  • Revision ID: tim.bentley@gmail.com-20160519060035-l8coui336at0fode
Fix ssl version to allow Android to use ssl. SSL is now auto negotiated. Fix SeriveManager service theme hiding. Bug since 1.9 series. Fix missing check dependancies for six, Fix PEP 8 errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
221
221
        self.request_data = None
222
222
        url_path_split = urlparse(url_path)
223
223
        url_query = parse_qs(url_path_split.query)
224
 
        # GET
225
 
        if 'data' in url_query.keys():
226
 
            self.request_data = url_query['data'][0]
 
224
        # Get data from HTTP request
 
225
        if self.command == 'GET':
 
226
            if 'data' in url_query.keys():
 
227
                self.request_data = url_query['data'][0]
 
228
        elif self.command == 'POST':
 
229
            content_len = int(self.headers['content-length'])
 
230
            self.request_data = self.rfile.read(content_len).decode("utf-8")
227
231
        for route, func in self.routes:
228
232
            match = re.match(route, url_path_split.path)
229
233
            if match:
401
405
        log.debug('serve file request %s' % file_name)
402
406
        if not file_name:
403
407
            file_name = 'index.html'
404
 
        elif file_name == 'stage':
405
 
            file_name = 'stage.html'
406
 
        elif file_name == 'main':
407
 
            file_name = 'main.html'
 
408
        if '.' not in file_name:
 
409
            file_name += '.html'
408
410
        if file_name.startswith('/'):
409
411
            file_name = file_name[1:]
410
412
        path = os.path.normpath(os.path.join(self.html_dir, file_name))