Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 132adc8

Browse files
committed
changes to make the base URL of the XML sitemap correct
Signed-off-by: Neal Ensor <[email protected]>
1 parent 9f15521 commit 132adc8

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/gov/osti/services/GoogleSitemapService.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,8 @@ public Response getSitemapList() {
7777
for (int i = 0; i < numOfPages; i++) {
7878
xml_string.append("<sitemap>");
7979
xml_string.append("<loc>")
80-
.append(uri.getBaseUri())
81-
.append(uri.getPath())
82-
.append("/")
80+
.append(SITE_URL)
81+
.append("/api/sitemap/xml/")
8382
.append(i + 1)
8483
.append("</loc>");
8584
xml_string.append("<lastmod>").append(moddedDate).append("</lastmod>");
@@ -125,7 +124,7 @@ public Response getSitemapPage(@PathParam("pageNum") Long pageNum) {
125124
xml_string.append("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">");
126125
query.getDocs().forEach((record) -> {
127126
xml_string.append("<url>");
128-
xml_string.append("<loc>").append(SITE_URL).append("/biblio" + "/").append(record.getCodeId()).append("</loc>");
127+
xml_string.append("<loc>").append(SITE_URL).append("/biblio/").append(record.getCodeId()).append("</loc>");
129128
xml_string.append("<lastmod>")
130129
.append(DATE_FORMATTER
131130
.format( (null==record.getDateRecordUpdated()) ? LocalDate.now() : record.getDateRecordUpdated().toInstant()) )

0 commit comments

Comments
 (0)