File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -71,33 +71,26 @@ public void Stop()
7171 _host = null ;
7272 }
7373
74- internal class Startup : IStartup
74+ internal class Startup ( MetricServerOptions options ) : IStartup
7575 {
76- private readonly MetricServerOptions _options ;
77-
78- public Startup ( MetricServerOptions options )
79- {
80- _options = options ;
81- }
82-
8376 public IServiceProvider ConfigureServices ( IServiceCollection services )
8477 {
8578 return services . BuildServiceProvider ( ) ;
8679 }
8780
8881 public void Configure ( IApplicationBuilder app )
8982 {
90- var contentType = _options . ResponseEncoding != null
91- ? $ "{ Defaults . ContentType } ; charset={ _options . ResponseEncoding . BodyName } "
83+ var contentType = options . ResponseEncoding != null
84+ ? $ "{ Defaults . ContentType } ; charset={ options . ResponseEncoding . BodyName } "
9285 : Defaults . ContentType ;
93- app . Map ( _options . MapPath , coreapp =>
86+ app . Map ( options . MapPath , coreapp =>
9487 {
9588 coreapp . Run ( async context =>
9689 {
9790 var response = context . Response ;
9891 response . ContentType = contentType ;
9992 await using var outputStream = response . Body ;
100- await ScrapeHandler . ProcessAsync ( _options . CollectorRegistry , outputStream ) ;
93+ await ScrapeHandler . ProcessAsync ( options . CollectorRegistry , outputStream ) ;
10194 } ) ;
10295 } ) ;
10396 }
You can’t perform that action at this time.
0 commit comments