367 |
367 |
368 # determine the requests content type |
368 # determine the requests content type |
369 contentTypeHeader = request.rawHeader(b"Content-Type") |
369 contentTypeHeader = request.rawHeader(b"Content-Type") |
370 if contentTypeHeader.isEmpty(): |
370 if contentTypeHeader.isEmpty(): |
371 return |
371 return |
372 multipart = contentTypeHeader.startsWith("multipart/form-data") |
372 multipart = contentTypeHeader.startsWith(b"multipart/form-data") |
373 if multipart: |
373 if multipart: |
374 boundary = contentTypeHeader.split(" ")[1].split("=")[1] |
374 boundary = contentTypeHeader.split(" ")[1].split("=")[1] |
375 else: |
375 else: |
376 boundary = None |
376 boundary = None |
377 |
377 |
468 else: |
468 else: |
469 if qVersion() >= "5.0.0": |
469 if qVersion() >= "5.0.0": |
470 from PyQt5.QtCore import QUrlQuery |
470 from PyQt5.QtCore import QUrlQuery |
471 argsUrl = QUrl.fromEncoded( |
471 argsUrl = QUrl.fromEncoded( |
472 QByteArray(b"foo://bar.com/?" + QUrl.fromPercentEncoding( |
472 QByteArray(b"foo://bar.com/?" + QUrl.fromPercentEncoding( |
473 data.replace(b"+", b"%20")).encode())) |
473 data.replace(b"+", b"%20")).encode("utf-8"))) |
474 encodedArgs = QUrlQuery(argsUrl).queryItems() |
474 encodedArgs = QUrlQuery(argsUrl).queryItems() |
475 else: |
475 else: |
476 argsUrl = QUrl.fromEncoded( |
476 argsUrl = QUrl.fromEncoded( |
477 QByteArray(b"foo://bar.com/?" + data.replace(b"+", b"%20")) |
477 QByteArray(b"foo://bar.com/?" + data.replace(b"+", b"%20")) |
478 ) |
478 ) |