Skip to content

Commit af7c617

Browse files
carolynvsFreedomFaighter
authored andcommitted
squash to head of master
Don't overwrite a custom set HttpClientFactory An end-user, or unit tests, should be able to set a custom HttpClientFactory and not have OpenStackNet.Configure() nuke it. changed stream closing to scoped closing of stream reads added .vs/ directory to gitignore dot vs ignore correction updated to correct notation for ignore of a directory in the root folder of repository
1 parent 9ff6bc7 commit af7c617

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,6 @@ docs/html/
7777

7878
#NuGet
7979
*.nupkg
80-
/src/packages/
80+
src/packages/
81+
.vs/
82+
src/UpgradeLog.htm

src/corelib/OpenStackNet.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ public static void Configure(Action<FlurlHttpConfigurationOptions> configureFlur
6060

6161
FlurlHttp.Configure(c =>
6262
{
63-
// Apply our default settings
64-
c.HttpClientFactory = new AuthenticatedHttpClientFactory();
65-
6663
// Apply the application's default settings
6764
if (configureFlurl != null)
6865
configureFlurl(c);
6966

67+
//
68+
// Apply our default settings
69+
//
70+
if(c.HttpClientFactory is DefaultHttpClientFactory)
71+
c.HttpClientFactory = new AuthenticatedHttpClientFactory();
72+
7073
// Apply our event handling without clobbering any application level handlers
7174
var applicationBeforeCall = c.BeforeCall;
7275
c.BeforeCall = call =>

src/testing/integration/Providers/Rackspace/UserObjectStorageTests.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,6 @@ public void TestExtractArchiveTar()
17131713
archive.RootPath = Path.GetDirectoryName(Path.GetFullPath(sourceFileName)).Replace('\\', '/');
17141714
TarEntry entry = TarEntry.CreateEntryFromFile(sourceFileName);
17151715
archive.WriteEntry(entry, true);
1716-
archive.Close();
17171716
}
17181717

17191718
outputStream.Flush();
@@ -1769,7 +1768,6 @@ public void TestExtractArchiveTarGz()
17691768
archive.RootPath = Path.GetDirectoryName(Path.GetFullPath(sourceFileName)).Replace('\\', '/');
17701769
TarEntry entry = TarEntry.CreateEntryFromFile(sourceFileName);
17711770
archive.WriteEntry(entry, true);
1772-
archive.Close();
17731771
}
17741772
}
17751773

@@ -1825,7 +1823,6 @@ public void TestExtractArchiveTarBz2()
18251823
archive.RootPath = Path.GetDirectoryName(Path.GetFullPath(sourceFileName)).Replace('\\', '/');
18261824
TarEntry entry = TarEntry.CreateEntryFromFile(sourceFileName);
18271825
archive.WriteEntry(entry, true);
1828-
archive.Close();
18291826
}
18301827
}
18311828

@@ -1884,7 +1881,6 @@ public void TestExtractArchiveTarGzCreateContainer()
18841881
tarOutputStream.PutNextEntry(entry);
18851882
tarOutputStream.Write(content, 0, content.Length);
18861883
tarOutputStream.CloseEntry();
1887-
tarOutputStream.Close();
18881884
}
18891885
}
18901886

0 commit comments

Comments
 (0)