Skip to content
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

Add %20 causes "Host requires authentication" error #19

Open
JoseExposito opened this issue Nov 20, 2013 · 1 comment
Open

Add %20 causes "Host requires authentication" error #19

JoseExposito opened this issue Nov 20, 2013 · 1 comment

Comments

@JoseExposito
Copy link

First I have to say that I'm using this library in a slightly weird way. I'm storing the consumer secret/key and the token/token secret in my DB and creating an O1 object using this code:

O1 *AbstractMessage::createO1()
{
    O1 *oauth = new O1(this);
    oauth->setClientId(loginInfo->consumerKey);
    oauth->setClientSecret(loginInfo->consumerSecret);
    oauth->setToken(loginInfo->token);
    oauth->setTokenSecret(loginInfo->tokenSecret);
    return oauth;
}

QNetworkReply *AbstractMessage::oauthGetRequest(const QString &url)
{
    O1 *oauth = this->createO1();
    O1Requestor *requestor = new O1Requestor(this->networkAccessManager, oauth, this);
    return requestor->get(QNetworkRequest(url), QList<O1RequestParameter>());
}

I don't know if this can cause the error.

Calling to "oauthGetRequest()" with a URL like "https://one.ubuntu.com/api/file_storage/v1/~/foo" works like a charm.

However, when I try to do exactly the same with this URL "https://one.ubuntu.com/api/file_storage/v1/~/foo%20bar" or this other "https://one.ubuntu.com/api/file_storage/v1/~/foo?include_children=true" I'm getting a "Host requires authentication" error.

Could be this a problem with the way I'm using the library or could it be a bug?

@pipacs
Copy link
Owner

pipacs commented Nov 20, 2013

Unfortunately I don't know.

Akos.

Akos Polster
http://quantisproject.com

On 20 Nov 2013, at 18:46, José Expósito [email protected] wrote:

First I have to say that I'm using this library in a slightly weird way. I'm storing the consumer secret/key and the token/token secret in my DB and creating an O1 object using this code:

O1 *AbstractMessage::createO1()
{
O1 *oauth = new O1(this);
oauth->setClientId(loginInfo->consumerKey);
oauth->setClientSecret(loginInfo->consumerSecret);
oauth->setToken(loginInfo->token);
oauth->setTokenSecret(loginInfo->tokenSecret);
return oauth;
}

QNetworkReply *AbstractMessage::oauthGetRequest(const QString &url)
{
O1 *oauth = this->createO1();
O1Requestor *requestor = new O1Requestor(this->networkAccessManager, oauth, this);
return requestor->get(QNetworkRequest(url), QList());
}
I don't know if this can cause the error.

Calling to "oauthGetRequest()" with a URL like "https://one.ubuntu.com/api/file_storage/v1/~/foo" works like a charm.

However, when I try to do exactly the same with this URL "https://one.ubuntu.com/api/file_storage/v1/~/foo%20bar" or this other "https://one.ubuntu.com/api/file_storage/v1/~/foo?include_children=true" I'm getting a "Host requires authentication" error.

Could be this a problem with the way I'm using the library or could it be a bug?


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants