File tree Expand file tree Collapse file tree 1 file changed +15
-11
lines changed
curation-web/src/main/java/eu/clarin/cmdi/curation/web/controller Expand file tree Collapse file tree 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change 1313import org .apache .commons .io .FileUtils ;
1414import org .springframework .beans .factory .annotation .Autowired ;
1515import org .springframework .http .MediaType ;
16+ import org .springframework .http .ResponseEntity ;
1617import org .springframework .stereotype .Controller ;
1718import org .springframework .ui .Model ;
1819import org .springframework .web .bind .annotation .GetMapping ;
1920import org .springframework .web .bind .annotation .PostMapping ;
2021import org .springframework .web .bind .annotation .RequestMapping ;
2122import org .springframework .web .bind .annotation .RequestParam ;
22- import org .springframework .web .bind .annotation .ResponseBody ;
2323import org .springframework .web .multipart .MultipartFile ;
2424
2525import java .io .IOException ;
@@ -233,15 +233,19 @@ private Path curate(Path inFilePath) {
233233 * @return the robots txt
234234 */
235235 @ GetMapping ("/robots.txt" )
236- @ ResponseBody
237- public String getRobotsTxt () {
238- return """
239- User-agent: *
240- Disallow: /download
241- Disallow: /record
242-
243- User-agent: CLARIN Linkchecker: https://www.clarin.eu/linkchecker
244- Allow: /
245- """ ;
236+ public ResponseEntity <String > getRobotsTxt () {
237+ return ResponseEntity
238+ .ok ()
239+ .contentType (MediaType .TEXT_PLAIN )
240+ .body (
241+ """
242+ User-agent: *
243+ Disallow: /download
244+ Disallow: /record
245+
246+ User-agent: CLARIN Linkchecker: https://www.clarin.eu/linkchecker
247+ Allow: /
248+ """
249+ );
246250 }
247251}
You can’t perform that action at this time.
0 commit comments