Skip to content

Commit

Permalink
#31022 Setting conHost in the PageCollector
Browse files Browse the repository at this point in the history
  • Loading branch information
freddyDOTCMS committed Jan 6, 2025
1 parent e0b5efc commit 1e42cd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.dotmarketing.portlets.htmlpageasset.business.HTMLPageAssetAPI;
import com.dotmarketing.portlets.htmlpageasset.model.IHTMLPage;
import com.dotmarketing.util.PageMode;
import com.liferay.util.StringPool;
import io.vavr.control.Try;

import java.util.HashMap;
Expand Down Expand Up @@ -94,6 +95,7 @@ public CollectorPayloadBean collect(final CollectorContextMap collectorContextMa
pageObject.put(WORKING, String.valueOf(Try.of(()->page.isWorking()).getOrElse(false)));
collectorPayloadBean.put(EVENT_TYPE, EventType.PAGE_REQUEST.getType());
}

pageObject.put(URL, uri);
}

Expand All @@ -104,6 +106,7 @@ public CollectorPayloadBean collect(final CollectorContextMap collectorContextMa

if (Objects.nonNull(site)) {
collectorPayloadBean.put(SITE_NAME, site.getHostname());
collectorPayloadBean.put(SITE_ID, site.getIdentifier());
}

return collectorPayloadBean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ public RequestMatcher getRequestMatcher() {
Assert.assertEquals("www.dotcms.com", collectorPayloadBean.get(Collector.SITE_NAME));
Assert.assertEquals("en", collectorPayloadBean.get(Collector.LANGUAGE));
Assert.assertEquals(EventType.PAGE_REQUEST.getType(), collectorPayloadBean.get(Collector.EVENT_TYPE));
Assert.assertEquals("1", collectorPayloadBean.get(Collector.SITE_ID));
}
}

0 comments on commit 1e42cd2

Please sign in to comment.