Skip to content

Commit

Permalink
Uri: Fix parsing login URI
Browse files Browse the repository at this point in the history
  • Loading branch information
melvo authored and lnjX committed Sep 10, 2024
1 parent 1935fde commit ad99be9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/base/QXmppUri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ Join parseJoinQuery(const QUrlQuery &q)
Login parseLoginQuery(const QUrlQuery &q)
{
return {
queryItemValue(q, u"login"_s),
queryItemValue(q, u"password"_s),
};
}

Expand Down
5 changes: 5 additions & 0 deletions tests/qxmppuri/tst_qxmppuri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ void tst_QXmppUri::queryOther()
QCOMPARE(unwrap<Uri::Join>(uri.query()), (Uri::Join { u"1234"_s }));
QCOMPARE(uri.toString(), string);

string = u"xmpp:[email protected]?login;password=1234"_s;
uri = unwrap(QXmppUri::fromString(string));
QCOMPARE(unwrap<Uri::Login>(uri.query()), (Uri::Login { u"1234"_s }));
QCOMPARE(uri.toString(), string);

string = u"xmpp:qxmpp.org?register"_s;
uri = unwrap(QXmppUri::fromString(string));
QCOMPARE(unwrap<Uri::Register>(uri.query()), (Uri::Register {}));
Expand Down

0 comments on commit ad99be9

Please sign in to comment.