Skip to content

Commit aa0bbff

Browse files
authored
Remove ResourceController mappings with param useDefaultLabel (#1728)
Fixes gh-1643
1 parent cb57c25 commit aa0bbff

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/resource/ResourceController.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,6 @@ public String retrieve(@PathVariable String name, @PathVariable String profile,
106106
return retrieve(request, name, profile, label, path, resolvePlaceholders);
107107
}
108108

109-
@RequestMapping(value = "/{name}/{profile}/**", params = "useDefaultLabel")
110-
public String retrieve(@PathVariable String name, @PathVariable String profile, ServletWebRequest request,
111-
@RequestParam(defaultValue = "true") boolean resolvePlaceholders) throws IOException {
112-
String path = getFilePath(request, name, profile, null);
113-
return retrieve(request, name, profile, null, path, resolvePlaceholders);
114-
}
115-
116109
private String getFilePath(ServletWebRequest request, String name, String profile, String label) {
117110
String stem;
118111
if (label != null) {
@@ -174,14 +167,6 @@ public byte[] binary(@PathVariable String name, @PathVariable String profile, @P
174167
return binary(request, name, profile, label, path);
175168
}
176169

177-
@RequestMapping(value = "/{name}/{profile}/**", params = "useDefaultLabel",
178-
produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
179-
public byte[] binary(@PathVariable String name, @PathVariable String profile, ServletWebRequest request)
180-
throws IOException {
181-
String path = getFilePath(request, name, profile, null);
182-
return binary(request, name, profile, null, path);
183-
}
184-
185170
/*
186171
* Used only for unit tests.
187172
*/

spring-cloud-config-server/src/test/java/org/springframework/cloud/config/server/resource/ResourceControllerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,12 +297,12 @@ private String replaceNewLines(String text) {
297297
}
298298

299299
@Test
300-
public void defaultLabelForBinary() throws Exception {
300+
public void nullLabelForBinary() throws Exception {
301301
this.environmentRepository.setSearchLocations("classpath:/test/{application}");
302302
MockHttpServletRequest request = new MockHttpServletRequest();
303303
ServletWebRequest webRequest = new ServletWebRequest(request, new MockHttpServletResponse());
304304
request.setRequestURI("/dev/spam/bar/" + "foo.txt");
305-
byte[] resource = this.controller.binary("dev/spam", "bar", webRequest);
305+
byte[] resource = this.controller.binary("dev/spam", "bar", null, webRequest);
306306
assertThat(new String(resource)).isEqualToIgnoringNewLines("foo: dev_bar/spam");
307307
}
308308

0 commit comments

Comments
 (0)