File tree Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Expand file tree Collapse file tree 2 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,8 @@ public MetricServer(MetricServerOptions options)
34
34
if ( options == null )
35
35
throw new ArgumentNullException ( nameof ( options ) ) ;
36
36
37
- if ( string . IsNullOrEmpty ( options . MapPath ) || ! options . MapPath . StartsWith ( "/" ) )
38
- throw new ArgumentException ( $ "mapPath ' { options . MapPath } ' should start with '/'" ) ;
37
+ if ( ! options . MapPath . StartsWith ( "/" ) )
38
+ options . MapPath = "/" + options . MapPath ;
39
39
40
40
_options = options ;
41
41
Original file line number Diff line number Diff line change @@ -113,13 +113,6 @@ public async Task MapPath_WithEndSlash()
113
113
}
114
114
}
115
115
116
- [ Fact ]
117
- public void Wrong_MapPath ( )
118
- {
119
- Assert . Throws < ArgumentException > ( ( ) => new MetricServer (
120
- new MetricServerOptions { Port = _port , MapPath = "temp" } ) ) ;
121
- }
122
-
123
116
[ Theory ]
124
117
[ InlineData ( "/metrics" ) ]
125
118
[ InlineData ( "/metrics12" ) ]
@@ -306,7 +299,6 @@ public async Task Add_Encoding()
306
299
}
307
300
}
308
301
309
-
310
302
[ Fact ]
311
303
public void Null_Options_Throws_ArgumentNullException ( )
312
304
{
You can’t perform that action at this time.
0 commit comments