Skip to content

Commit

Permalink
Add restrictToPublished param as true in order to obtain the nearest …
Browse files Browse the repository at this point in the history
…published branding at runtime.
  • Loading branch information
dhaura committed Jul 29, 2024
1 parent 756cf46 commit 1f6c668
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2023, WSO2 LLC. (http://www.wso2.com).
* Copyright (c) 2021-2024, WSO2 LLC. (http://www.wso2.com).
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
Expand Down Expand Up @@ -55,6 +55,8 @@ public class BrandingPreferenceRetrievalClient {
private static final String RESOURCE_NAME_URL_SEARCH_PARAM = "name";
private static final String RESOURCE_LOCALE_URL_SEARCH_PARAM = "locale";
private static final String RESOURCE_SCREEN_URL_SEARCH_PARAM = "screen";
private static final String RESTRICT_TO_PUBLISHED_URL_SEARCH_PARAM = "restrictToPublished";
private static final String TRUE = "true";

/**
* Check for branding preference in the given tenant.
Expand Down Expand Up @@ -87,6 +89,8 @@ public JSONObject getPreference(String tenant, String type, String name, String
if (StringUtils.isNotBlank(locale)) {
uriBuilder.addParameter(RESOURCE_LOCALE_URL_SEARCH_PARAM, locale);
}

uriBuilder.addParameter(RESTRICT_TO_PUBLISHED_URL_SEARCH_PARAM, TRUE);
uri = uriBuilder.build().toString();

if (log.isDebugEnabled()) {
Expand Down

0 comments on commit 1f6c668

Please sign in to comment.