Merge pull request #7543 from peppy/fix-registration

Fix user agent missing in registration request
This commit is contained in:
Dan Balasescu 2020-01-16 13:17:05 +09:00 committed by GitHub
commit 86ae442d54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 12 deletions

View File

@ -162,16 +162,6 @@ namespace osu.Game.Online.API
[JsonProperty("error")]
public string ErrorMessage { get; set; }
}
private class OsuWebRequest : WebRequest
{
public OsuWebRequest(string uri)
: base(uri)
{
}
protected override string UserAgent => "osu!";
}
}
public class APIException : InvalidOperationException

View File

@ -0,0 +1,21 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.IO.Network;
namespace osu.Game.Online.API
{
public class OsuWebRequest : WebRequest
{
public OsuWebRequest(string uri)
: base(uri)
{
}
public OsuWebRequest()
{
}
protected override string UserAgent => "osu!";
}
}

View File

@ -2,11 +2,10 @@
// See the LICENCE file in the repository root for full licence text.
using Newtonsoft.Json;
using osu.Framework.IO.Network;
namespace osu.Game.Online.API
{
public class RegistrationRequest : WebRequest
public class RegistrationRequest : OsuWebRequest
{
internal string Username;
internal string Email;