Skip to content

Commit 4bac6e0

Browse files
Tomasz Lelekmogronalol
authored andcommitted
BAEL-614 endpoint that has default cache-control headers
1 parent 3fa1b93 commit 4bac6e0

2 files changed

Lines changed: 6 additions & 21 deletions

File tree

‎spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/ResourceEndpoint.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,10 @@ public ResponseEntity<TimestampDto> getServerTimestamp() {
3232
.cacheControl(CacheControl.noCache())
3333
.body(new TimestampDto(LocalDateTime.now().toInstant(ZoneOffset.UTC).toEpochMilli()));
3434
}
35+
36+
@RequestMapping(value = "/private/users/{name}", method = RequestMethod.GET)
37+
public ResponseEntity<UserDto> getUserNotCached(@PathVariable("name") String name) {
38+
return ResponseEntity.ok()
39+
.body(new UserDto(name));
40+
}
3541
}

‎spring-security-cache-control/src/main/java/com/baeldung/cachecontrol/config/WebConfiguration.java‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)