From 383952c60eca2a551145e95ede92aba27204ee7a Mon Sep 17 00:00:00 2001 From: Ainur <59531286+yagudin10@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:45:13 +0300 Subject: [PATCH 1/2] CB-5838 check all row identifiers fix (#3014) Co-authored-by: DenisSinelnikov <142215442+DenisSinelnikov@users.noreply.github.com> --- .../service/sql/WebSQLQueryDataReceiver.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryDataReceiver.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryDataReceiver.java index 89bdc1e5f1..3a53466590 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryDataReceiver.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLQueryDataReceiver.java @@ -35,10 +35,7 @@ import org.jkiss.utils.CommonUtils; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; class WebSQLQueryDataReceiver implements DBDDataReceiver { @@ -170,8 +167,9 @@ public void fetchEnd(@NotNull DBCSession session, @NotNull DBCResultSet resultSe webResultSet.setSingleEntity(isSingleEntity); - DBDRowIdentifier rowIdentifier = resultsInfo.getDefaultRowIdentifier(); - webResultSet.setHasRowIdentifier(rowIdentifier != null && rowIdentifier.isValidIdentifier()); + Set rowIdentifiers = resultsInfo.getRowIdentifiers(); + boolean hasRowIdentifier = rowIdentifiers.stream().allMatch(DBDRowIdentifier::isValidIdentifier); + webResultSet.setHasRowIdentifier(!rowIdentifiers.isEmpty() && hasRowIdentifier); } private void convertComplexValuesToRelationalView(DBCSession session) { From e08353f13f4c5f4d948dc88d1475cfa3f56b6402 Mon Sep 17 00:00:00 2001 From: Ainur <59531286+yagudin10@users.noreply.github.com> Date: Wed, 23 Oct 2024 18:46:26 +0300 Subject: [PATCH 2/2] CB-5792 add header for static content (#3018) --- .../src/io/cloudbeaver/server/servlets/CBStaticServlet.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/CBStaticServlet.java b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/CBStaticServlet.java index 232d57f3f9..ee850f61d7 100644 --- a/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/CBStaticServlet.java +++ b/server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/server/servlets/CBStaticServlet.java @@ -42,6 +42,7 @@ import org.jkiss.dbeaver.model.auth.SMAuthInfo; import org.jkiss.dbeaver.model.auth.SMAuthProvider; import org.jkiss.dbeaver.model.security.SMAuthProviderCustomConfiguration; +import org.jkiss.dbeaver.utils.MimeTypes; import org.jkiss.utils.CommonUtils; import org.jkiss.utils.IOUtils; @@ -225,6 +226,7 @@ private void patchStaticContentIfNeeded(HttpServletRequest request, HttpServletR // Disable cache for index.html response.setHeader(HttpHeader.CACHE_CONTROL.toString(), "no-cache, no-store, must-revalidate"); + response.setHeader(HttpHeader.CONTENT_TYPE.toString(), MimeTypes.TEXT_HTML); response.setHeader(HttpHeader.EXPIRES.toString(), "0"); response.getOutputStream().write(ByteBuffer.wrap(indexBytes)); }