Add support for binary file server via context negotation
If client sends "Accept: application/octet-stream" then the server sends back a binary file (no placeholders and no text conversion)
This commit is contained in:
@@ -24,8 +24,6 @@ import org.junit.Test;
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.cloud.config.server.environment.NativeEnvironmentRepository;
|
||||
import org.springframework.cloud.config.server.environment.NativeEnvironmentRepositoryTests;
|
||||
import org.springframework.cloud.config.server.resource.GenericResourceRepository;
|
||||
import org.springframework.cloud.config.server.resource.ResourceController;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
/**
|
||||
@@ -66,6 +64,13 @@ public class ResourceControllerTests {
|
||||
assertEquals("{\n \"foo\": \"dev_bar\"\n}", resource);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void templateReplacementNotForBinary() throws Exception {
|
||||
this.environmentRepository.setSearchLocations("classpath:/test");
|
||||
String resource = new String(this.controller.binary("foo", "bar", "dev", "template.json"));
|
||||
assertEquals("{\n \"foo\": \"${foo}\"\n}", resource);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void escapedPlaceholder() throws Exception {
|
||||
this.environmentRepository.setSearchLocations("classpath:/test");
|
||||
|
||||
Reference in New Issue
Block a user