Skip to content

Commit 3651b60

Browse files
committed
pull in cors and volume configs end to end
1 parent 4bd122e commit 3651b60

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Testcontainers.Typesense/TypesenseBuilder.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,13 @@ public TypesenseBuilder WithApiKey(string apiKey)
5353
/// <returns>A configured instance of <see cref="TypesenseBuilder" />.</returns>
5454
public TypesenseBuilder EnableCors(bool enableCors)
5555
{
56-
return Merge(DockerResourceConfiguration, new TypesenseConfiguration(enableCors: enableCors))
57-
.WithCommand("--enable-cors");
56+
if (enableCors)
57+
{
58+
return Merge(DockerResourceConfiguration, new TypesenseConfiguration(enableCors: enableCors))
59+
.WithCommand("--enable-cors");
60+
}
61+
62+
return Merge(DockerResourceConfiguration, new TypesenseConfiguration(enableCors: enableCors));
5863
}
5964

6065
/// <summary>

src/Testcontainers.Typesense/TypesenseConfiguration.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ public TypesenseConfiguration(TypesenseConfiguration oldValue, TypesenseConfigur
5757
{
5858
ApiKey = BuildConfiguration.Combine(oldValue.ApiKey, newValue.ApiKey);
5959
Port = BuildConfiguration.Combine(oldValue.Port, newValue.Port);
60+
EnableCors = BuildConfiguration.Combine(oldValue.EnableCors, newValue.EnableCors);
61+
Volume = BuildConfiguration.Combine(oldValue.Volume, newValue.Volume);
6062
}
6163

6264
public string ApiKey { get; }

0 commit comments

Comments
 (0)