File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
src/dotnetframework/GxClasses/Domain
test/DotNetUnitTest/Domain Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -2001,7 +2001,7 @@ public void ToFile(string fileName)
20012001#if ! NETCORE
20022002 if ( HttpContext . Current != null )
20032003#endif
2004- if ( fileName . IndexOfAny ( new char [ ] { ' \\ ' , ':' } ) == - 1 )
2004+ if ( ! Path . IsPathRooted ( fileName ) )
20052005 pathName = Path . Combine ( GxContext . StaticPhysicalPath ( ) , fileName ) ;
20062006
20072007 if ( ReceiveData != null )
Original file line number Diff line number Diff line change @@ -189,6 +189,19 @@ public void HttpClientCookiesTest()
189189
190190 }
191191
192+ [ Fact ]
193+ public void ToRelativeFile ( )
194+ {
195+ using ( GxHttpClient client = new GxHttpClient ( ) )
196+ {
197+ client . Host = "localhost" ;
198+ client . BaseURL = "/dummy/lem.txt" ;
199+ client . Execute ( "GET" , string . Empty ) ;
200+ client . ToFile ( "./lem.txt" ) ;
201+ Assert . True ( File . Exists ( Path . Combine ( Directory . GetCurrentDirectory ( ) , "lem.txt" ) ) ) ;
202+ }
203+ }
204+
192205#if ! NETCORE
193206 [ Fact ]
194207 public void NoStoreHeader ( )
You can’t perform that action at this time.
0 commit comments