Reset UserAgent
This commit is contained in:
parent
abfe42b7c1
commit
6c9071b22b
@ -423,6 +423,10 @@ public class Server : GlobalBase
|
||||
settings.UpdateUserAgent(customUserAgent);
|
||||
SendResponse(HttpStatusCode.Accepted, response);
|
||||
break;
|
||||
case "Settings/userAgent/Reset":
|
||||
settings.UpdateUserAgent(null);
|
||||
SendResponse(HttpStatusCode.Accepted, response);
|
||||
break;
|
||||
case "Settings/customRequestLimit":
|
||||
if (!requestVariables.TryGetValue("requestType", out string? requestTypeStr) ||
|
||||
!requestVariables.TryGetValue("requestsPerMinute", out string? requestsPerMinuteStr) ||
|
||||
|
@ -129,9 +129,9 @@ public class TrangaSettings
|
||||
ExportSettings();
|
||||
}
|
||||
|
||||
public void UpdateUserAgent(string customUserAgent)
|
||||
public void UpdateUserAgent(string? customUserAgent)
|
||||
{
|
||||
this.userAgent = customUserAgent.Length < 1 ? DefaultUserAgent : customUserAgent;
|
||||
this.userAgent = customUserAgent ?? DefaultUserAgent;
|
||||
ExportSettings();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user