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