@@ -81,6 +81,19 @@ public Result<List<HttpRequest<BidRequest>>> makeHttpRequests(BidRequest request
8181 return Result .of (bidRequests , errors );
8282 }
8383
84+ private static String getDomain (BidRequest request ) {
85+ return Optional .ofNullable (request .getSite ())
86+ .map (Site ::getPage )
87+ .map (pageUrl -> {
88+ try {
89+ return new URIBuilder (pageUrl ).getHost ();
90+ } catch (URISyntaxException e ) {
91+ return null ;
92+ }
93+ })
94+ .orElse (null );
95+ }
96+
8497 private static String getReferer (BidRequest request ) {
8598 return Optional .ofNullable (request .getSite ())
8699 .map (Site ::getPage )
@@ -117,7 +130,7 @@ private static Imp modifyImp(Imp imp) {
117130 throw new PreBidException ("Imp #%s must contain at least one valid format (banner, video, or native)"
118131 .formatted (imp .getId ()));
119132 }
120-
133+
121134 return imp .toBuilder ()
122135 .displaymanager (DISPLAY_MANAGER )
123136 .displaymanagerver (DISPLAY_MANAGER_VERSION )
@@ -131,7 +144,7 @@ private static Banner modifyBanner(Banner banner) {
131144 if (banner == null ) {
132145 return null ;
133146 }
134-
147+
135148 final Integer weight = banner .getW ();
136149 final Integer height = banner .getH ();
137150 final List <Format > format = banner .getFormat ();
@@ -149,7 +162,7 @@ private static Video modifyVideo(Video video) {
149162 if (video == null ) {
150163 return null ;
151164 }
152-
165+
153166 final Integer width = video .getW ();
154167 final Integer height = video .getH ();
155168 if (width == null || height == null || width == 0 || height == 0 ) {
@@ -208,7 +221,7 @@ private static MultiMap headers(BidRequest bidRequest) {
208221 final MultiMap headers = HttpUtil .headers ();
209222
210223 headers .add (HttpUtil .X_OPENRTB_VERSION_HEADER , "2.5" );
211- HttpUtil .addHeaderIfValueIsNotEmpty (headers , "Referer" , getReferer (bidRequest ));
224+ HttpUtil .addHeaderIfValueIsNotEmpty (headers , "Referer" , getDomain (bidRequest ));
212225
213226 final Device device = bidRequest .getDevice ();
214227 if (device != null ) {
0 commit comments