最近,我发现了Tus协议(tusdotnet)的.NET实现,正在将其用于可恢复的文件上传。 tusdotnet在后台创建一个api来管理文件。上传和恢复按预期方式工作,但是当我调用删除端点时,在服务器日志中看到了这一点:
...
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 DELETE http://localhost:5000/api/files/53517b97052145d587144586cb0771a7 0
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[2]
Successfully validated the token.
info: Microsoft.AspNetCore.Server.Kestrel[17]
Connection id "0HLMGF3SR07CI" bad request data: "Request headers too long."
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Request headers too long.
at Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException.Throw(RequestRejectionReason reason)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TakeMessageHeaders(ReadOnlySequence`1 buffer, SequencePosition& consumed, SequencePosition& examined)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.ParseRequest(ReadOnlySequence`1 buffer, SequencePosition& consumed, SequencePosition& examined)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1Connection.TryParseRequest(ReadResult result, Boolean& endConnection)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequestsAsync[TContext](IHttpApplication`1 application)
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 5.63ms 431
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 9.6507ms 431
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 13.6635ms 431
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 18.2374ms 431
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 22.7664ms 431
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 26.6078ms 431
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 30.5116ms 431
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 34.3513ms 431
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 38.3285ms 431
...
从外观上看,它似乎只是一遍又一遍地处理请求。
为什么关于1个请求的日志太多?什么会引起这样的问题?