diff --git a/MP.RIOC/MP.RIOC.csproj b/MP.RIOC/MP.RIOC.csproj
index a639b26d..a7f0e7f1 100644
--- a/MP.RIOC/MP.RIOC.csproj
+++ b/MP.RIOC/MP.RIOC.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.RIOC
- 8.16.2605.906
+ 8.16.2605.910
diff --git a/MP.RIOC/Resources/ChangeLog.html b/MP.RIOC/Resources/ChangeLog.html
index c5744730..4bf268b2 100644
--- a/MP.RIOC/Resources/ChangeLog.html
+++ b/MP.RIOC/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MP-RIOC
- Versione: 8.16.2605.906
+ Versione: 8.16.2605.910
Note di rilascio:
-
diff --git a/MP.RIOC/Resources/VersNum.txt b/MP.RIOC/Resources/VersNum.txt
index ed7d9218..c8db13cb 100644
--- a/MP.RIOC/Resources/VersNum.txt
+++ b/MP.RIOC/Resources/VersNum.txt
@@ -1 +1 @@
-8.16.2605.906
+8.16.2605.910
diff --git a/MP.RIOC/Resources/manifest.xml b/MP.RIOC/Resources/manifest.xml
index 7b67ff9d..f74a5184 100644
--- a/MP.RIOC/Resources/manifest.xml
+++ b/MP.RIOC/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 8.16.2605.906
+ 8.16.2605.910
https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/MP.RIOC.zip
https://nexus.steamware.net/repository/SWS/MP-RIOC/stable/LAST/ChangeLog.html
false
diff --git a/MP.RIOC/Services/PreserveBodyTransformer.cs b/MP.RIOC/Services/PreserveBodyTransformer.cs
index 2434f658..637699d0 100644
--- a/MP.RIOC/Services/PreserveBodyTransformer.cs
+++ b/MP.RIOC/Services/PreserveBodyTransformer.cs
@@ -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 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.
}
}
}
diff --git a/MP.RIOC/Services/RouteManager.cs b/MP.RIOC/Services/RouteManager.cs
index d7d8c173..2dd96b89 100644
--- a/MP.RIOC/Services/RouteManager.cs
+++ b/MP.RIOC/Services/RouteManager.cs
@@ -25,7 +25,7 @@ namespace MP.RIOC.Services
_routePath = _config.GetValue("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("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);
diff --git a/MP.RIOC/appsettings.json b/MP.RIOC/appsettings.json
index 59920eab..590b8fb4 100644
--- a/MP.RIOC/appsettings.json
+++ b/MP.RIOC/appsettings.json
@@ -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",