Merge branch 'Release/TestFix_CICD_RIOC_02'

This commit is contained in:
Samuele Locatelli
2026-05-09 10:19:37 +02:00
8 changed files with 17 additions and 32 deletions
+2 -1
View File
@@ -121,7 +121,8 @@ if (app.Environment.IsDevelopment() || app.Environment.IsStaging())
}
logger.Info("Added swagger");
app.UseHttpsRedirection();
//// redirect su https: disattiato x API
//app.UseHttpsRedirection();
app.UseAuthorization();
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.RIOC</RootNamespace>
<Version>8.16.2605.906</Version>
<Version>8.16.2605.910</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MP-RIOC </i>
<h4>Versione: 8.16.2605.906</h4>
<h4>Versione: 8.16.2605.910</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
8.16.2605.906
8.16.2605.910
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>8.16.2605.906</version>
<version>8.16.2605.910</version>
<url>https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/MP.RIOC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+5 -23
View File
@@ -6,33 +6,15 @@ namespace MP.RIOC.Services
{
public override async ValueTask TransformRequestAsync(HttpContext httpContext, HttpRequestMessage proxyRequest, string destinationPrefix, CancellationToken cancellationToken)
{
// Chiama il base (usa overload con cancellationToken)
// 1. Lascia che YARP faccia il lavoro pesante di copia (headers, etc.)
await base.TransformRequestAsync(httpContext, proxyRequest, destinationPrefix, cancellationToken);
// Imposta il method correttamente
// 2. Il metodo viene già gestito da YARP, ma forzarlo non fa male
proxyRequest.Method = new HttpMethod(httpContext.Request.Method);
// Se vuoi leggere/loggare il body, abilita buffering e rewind.
// NON assegnare proxyRequest.Content: YARP copierà il body da HttpContext.Request.
if (httpContext.Request.ContentLength > 0 || httpContext.Request.Body.CanRead)
{
// Abilita buffering solo se necessario (attenzione a payload grandi)
httpContext.Request.EnableBuffering();
// Rewind per sicurezza
httpContext.Request.Body.Position = 0;
// Se vuoi leggere il body per logging, fallo qui ma non sostituire proxyRequest.Content.
// Esempio (opzionale): leggere senza consumare
// using var sr = new StreamReader(httpContext.Request.Body, leaveOpen: true);
// var bodyText = await sr.ReadToEndAsync();
// httpContext.Request.Body.Position = 0;
}
}
public override ValueTask<bool> TransformResponseAsync(HttpContext httpContext, HttpResponseMessage? proxyResponse, CancellationToken cancellationToken)
{
return base.TransformResponseAsync(httpContext, proxyResponse, cancellationToken);
// NOTA: Se non stai leggendo il body qui per fare logging,
// rimuovi completamente EnableBuffering e il reset della Position.
// YARP leggerà lo stream direttamente da httpContext.Request.Body verso il backend.
}
}
}
+4 -2
View File
@@ -25,7 +25,7 @@ namespace MP.RIOC.Services
_routePath = _config.GetValue<string>("ServerConf:RoutePath") ?? "/api/IOB";
_forwarderConfig = new ForwarderRequestConfig
{
ActivityTimeout = TimeSpan.FromSeconds(30),
ActivityTimeout = TimeSpan.FromSeconds(60),
// Parse della versione (es. "1.1")
Version = Version.Parse(_config.GetValue<string>("ServerConf:HttpVersion") ?? "1.1"),
// Policy per la versione
@@ -99,7 +99,9 @@ namespace MP.RIOC.Services
context.Request.PathBase = PathString.Empty;
// Esecuzione
var error = await _forwarder.SendAsync(context, destBase, _httpClientInvoker, _forwarderConfig, _transformer, context.RequestAborted);
var error = await _forwarder.SendAsync(context, destBase, _httpClientInvoker, _forwarderConfig, HttpTransformer.Default, context.RequestAborted);
// commento transformer custom
//var error = await _forwarder.SendAsync(context, destBase, _httpClientInvoker, _forwarderConfig, _transformer, context.RequestAborted);
sw.Stop();
_stats.RecordDuration(sKey, sw.Elapsed);
+2 -2
View File
@@ -61,8 +61,8 @@
"RoutePath": "/api/IOB",
"HttpVersion": "1.1",
"HttpVersionPolicy": "RequestVersionExact",
"OldApiUrl": "https://iis01.egalware.com/MP/IO/IOB/",
"NewApiUrl": "https://iis01.egalware.com/MP/IOC/api/IOB/",
"OldApiUrl": "http://iis01.egalware.com/MP/IO/IOB/",
"NewApiUrl": "http://iis01.egalware.com/MP/IOC/api/IOB/",
"BaseUrlIoc": "/MP/RIOC/",
"MpIoNS": "MoonPro:SQL2016DEV:MoonPro",
"RedisBaseKey": "MP-IOC",