File tree Expand file tree Collapse file tree
server/src/main/java/dev/findfirst/core/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,14 +26,16 @@ public RobotsTxtResponse getRobotsTxt(String url) {
2626 uri .getFragment ());
2727
2828 ResponseEntity <String > robots = rest .getForEntity (robotsUri , String .class );
29+ String text = !robots .getBody ().isBlank () ? robots .getBody () : "" ;
2930
30- return new RobotsTxtResponse (robots .getStatusCode ().value (), robots .getBody ().getBytes (),
31+ return new RobotsTxtResponse (robots .getStatusCode ().value (),
32+ text .getBytes (),
3133 robots .getHeaders ().getContentType () == null ? ""
3234 : robots .getHeaders ().getContentType ().toString ());
3335
3436 } catch (URISyntaxException | HttpClientErrorException ex ) {
3537 log .error (ex .toString ());
36- return new RobotsTxtResponse (500 , "" .getBytes (), "" );
38+ return new RobotsTxtResponse (500 , ex . toString () .getBytes (), "" );
3739 }
3840 }
3941
You can’t perform that action at this time.
0 commit comments