2
0

Log output changes

This commit is contained in:
glax 2023-09-02 14:11:11 +02:00
parent ed79ee5d0f
commit a05e1914e3
3 changed files with 4 additions and 3 deletions

View File

@ -62,6 +62,7 @@ public abstract class Job : GlobalBase
public void Cancel() public void Cancel()
{ {
Log($"Cancelling {this}");
this.progressToken.cancellationRequested = true; this.progressToken.cancellationRequested = true;
this.progressToken.Complete(); this.progressToken.Complete();
} }

View File

@ -60,7 +60,7 @@ internal class DownloadClient : GlobalBase
if(referrer is not null) if(referrer is not null)
requestMessage.Headers.Referrer = new Uri(referrer); requestMessage.Headers.Referrer = new Uri(referrer);
_lastExecutedRateLimit[requestType] = DateTime.Now; _lastExecutedRateLimit[requestType] = DateTime.Now;
Log($"Requesting {requestType} {url}"); //Log($"Requesting {requestType} {url}");
response = Client.Send(requestMessage); response = Client.Send(requestMessage);
} }
catch (HttpRequestException e) catch (HttpRequestException e)

View File

@ -45,7 +45,7 @@ public class Server : GlobalBase
try try
{ {
HttpListenerContext context = this._listener.GetContext(); HttpListenerContext context = this._listener.GetContext();
Log($"{context.Request.HttpMethod} {context.Request.Url} {context.Request.UserAgent}"); //Log($"{context.Request.HttpMethod} {context.Request.Url} {context.Request.UserAgent}");
Task t = new(() => Task t = new(() =>
{ {
HandleRequest(context); HandleRequest(context);
@ -441,7 +441,7 @@ public class Server : GlobalBase
private void SendResponse(HttpStatusCode statusCode, HttpListenerResponse response, object? content = null) private void SendResponse(HttpStatusCode statusCode, HttpListenerResponse response, object? content = null)
{ {
Log($"Response: {statusCode} {content}"); //Log($"Response: {statusCode} {content}");
response.StatusCode = (int)statusCode; response.StatusCode = (int)statusCode;
response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept, X-Requested-With"); response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Accept, X-Requested-With");
response.AddHeader("Access-Control-Allow-Methods", "GET, POST, DELETE"); response.AddHeader("Access-Control-Allow-Methods", "GET, POST, DELETE");