-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix api_key encoding/decoding #6608
Conversation
retest this please |
2 similar comments
retest this please |
retest this please |
abc932e
to
726e658
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
retest this please |
@@ -37,7 +37,7 @@ def __init__(self, api_port, api_key, error_handler): | |||
QNetworkAccessManager.__init__(self) | |||
url = QUrl("http://localhost:%d/events" % api_port) | |||
self.request = QNetworkRequest(url) | |||
self.request.setRawHeader(b'X-Api-Key', api_key) | |||
self.request.setRawHeader(b'X-Api-Key', api_key.encode('ascii')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: are you sure that 'ascii' is the correct encoding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because we construct api_key
as hexlify(os.urandom(16))
. It contains ASCII symbols only.
This PR fixes #6607 by fixing encoding/decoding of
api_key
.