Skip to content

Commit

Permalink
2.8.1 Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
vbilopav committed May 10, 2024
1 parent 851f294 commit 72797a8
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 16 deletions.
4 changes: 2 additions & 2 deletions NpgsqlRest/MiddlewareExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,13 @@ public static IApplicationBuilder UseNpgsqlRest(this IApplicationBuilder builder
{
foreach (var header in options.CustomRequestHeaders)
{
//context.Request?.Headers?.Append(header);
context.Request?.Headers?.Add(header);
context.Request.Headers.Add(header);
}
}
headers = "{";
var i = 0;
foreach (var header in context.Request.Headers)
{
if (i++ > 0)
Expand Down
10 changes: 5 additions & 5 deletions NpgsqlRest/NpgsqlRest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageReadmeFile>README.MD</PackageReadmeFile>
<DocumentationFile>bin\$(Configuration)\$(AssemblyName).xml</DocumentationFile>
<Version>2.8.0</Version>
<AssemblyVersion>2.8.0</AssemblyVersion>
<FileVersion>2.8.0</FileVersion>
<PackageVersion>2.8.0</PackageVersion>
<Version>2.8.1</Version>
<AssemblyVersion>2.8.1</AssemblyVersion>
<FileVersion>2.8.1</FileVersion>
<PackageVersion>2.8.1</PackageVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
Expand All @@ -40,7 +40,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="Npgsql" Version="8.0.1" />
<PackageReference Include="Npgsql" Version="8.0.3" />
<PackageReferenceFiles Include="bin\$(Configuration)\$(AssemblyName).xml" />
</ItemGroup>

Expand Down
6 changes: 6 additions & 0 deletions NpgsqlRestClient/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ public static void Configure(WebApplication app, Action started)
{
app.UseHttpsRedirection();
}
if (UseHsts)
{
app.UseHsts();
}

if (LogToConsole is true || LogToFile is true)
{
app.UseSerilogRequestLogging();
}

var cfgCfg = Cfg.GetSection("Config");
var configEndpoint = GetConfigStr("ExposeAsEndpoint", cfgCfg);
if (configEndpoint is not null)
Expand Down
3 changes: 3 additions & 0 deletions NpgsqlRestClient/Builder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static class Builder
public static bool LogToFile { get; private set; } = false;
public static Serilog.ILogger? Logger { get; private set; } = null;
public static bool UseHttpsRedirection { get; private set; } = false;
public static bool UseHsts { get; private set; } = false;

public static void BuildInstance()
{
Expand Down Expand Up @@ -49,6 +50,7 @@ public static void BuildInstance()
{
Instance.WebHost.UseKestrelHttpsConfiguration();
UseHttpsRedirection = GetConfigBool("UseHttpsRedirection", ssqlCfg);
UseHsts = GetConfigBool("UseHsts", ssqlCfg);
}
}

Expand All @@ -63,6 +65,7 @@ public static void BuildLogger()
LogToFile = false;
return;
}

Logger = null;
LogToConsole = GetConfigBool("ToConsole", logCfg);
LogToFile = GetConfigBool("ToFile", logCfg);
Expand Down
2 changes: 1 addition & 1 deletion NpgsqlRestClient/NpgsqlRestClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<InvariantGlobalization>true</InvariantGlobalization>
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
<PublishAot>true</PublishAot>
<Version>1.2.0</Version>
<Version>1.2.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 5 additions & 1 deletion NpgsqlRestClient/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@
//
// Adds middleware for redirecting HTTP Requests to HTTPS. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.httpspolicybuilderextensions.usehttpsredirection?view=aspnetcore-8.0
//
"HttpsRedirection": true
"HttpsRedirection": true,
//
// Adds middleware for using HSTS, which adds the Strict-Transport-Security header. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.hstsbuilderextensions.usehsts?view=aspnetcore-2.1
//
"UseHsts": true
},

// //
Expand Down
2 changes: 1 addition & 1 deletion npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npgsqlrest",
"version": "1.2.0",
"version": "1.2.1",
"description": "Automatic REST API for PostgreSQL Databases Client Build",
"scripts": {
"postinstall": "node postinstall.js",
Expand Down
16 changes: 10 additions & 6 deletions npm/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,9 @@ $ npx npgsqlrest appsettings.json project-config.json

See the detailed change log here: [NpgsqlRest Changelog](https://vb-consulting.github.io/npgsqlrest/changelog/)

### 1.1.8

Changed the download target from `./node_modules/npgsqlrest/.bin/` to shared bin: `./node_modules/.bin/`.
### 1.2.1

The reason is that when using the `./node_modules/npgsqlrest/.bin/` directory, I have to use the node spawn process wrapper which slows down the startup time. When the executable is in the `./node_modules/.bin/` it can be invoked directly which is an extremely fast, almost instant startup (a couple of milliseconds).

But now, I have to use the uninstall script too, to ensure the proper cleanup on the install.
Fix readme

### 1.2.0

Expand All @@ -118,6 +114,14 @@ NpgsqlRest.HttpFiles 1.0.2.0
NpgsqlRest.TsClient 1.7.0.0
```

### 1.1.8

Changed the download target from `./node_modules/npgsqlrest/.bin/` to shared bin: `./node_modules/.bin/`.

The reason is that when using the `./node_modules/npgsqlrest/.bin/` directory, I have to use the node spawn process wrapper which slows down the startup time. When the executable is in the `./node_modules/.bin/` it can be invoked directly which is an extremely fast, almost instant startup (a couple of milliseconds).

But now, I have to use the uninstall script too, to ensure the proper cleanup on the install.

### 1.1.7

Update readme.
Expand Down

0 comments on commit 72797a8

Please sign in to comment.