Connection: "close" in HTTP headers in fetchWebServiceMap in MapComponent.js

This commit is contained in:
ISA
2024-09-10 14:04:39 +02:00
parent d57d86cf6c
commit 77bc63f22e
4 changed files with 17 additions and 12 deletions

View File

@@ -34,7 +34,12 @@ export const fetchGisStatusStations = async (idMap, idUser) => {
// Verwende das Timeout für die API-Anfrage
const response = await fetchWithTimeout(
`${SERVER_URL}/talas5/ClientData/WebServiceMap.asmx/GisStationsStatusDistrict?idMap=${idMap}&idUser=${idUser}`,
null,
{
method: "GET",
headers: {
Connection: "close", // Dieser Header stellt sicher, dass die Verbindung nach dem Abruf geschlossen wird
},
},
5000 // Timeout auf 5 Sekunden gesetzt
);
@@ -140,7 +145,7 @@ export const fetchUserRights = async () => {
const response = await fetch(`${process.env.NEXT_PUBLIC_SERVER_URL}/talas5/ClientData/WebserviceMap.asmx/GisSystemStatic?idMap=${config.idMap}&idUser=${config.idUser}`, {
method: "GET",
headers: {
Connection: "keep-alive", // Keep-Alive Header hinzufügen
Connection: "close",
},
});