prevent use of proxy if option is disabled

This commit is contained in:
Athou
2013-06-22 21:58:12 +02:00
parent 070276d7bd
commit d7ab27a147

View File

@@ -34,6 +34,10 @@ public class ServerREST extends AbstractResourceREST {
@ApiOperation(value = "proxy image")
@Produces("image/png")
public Response get(@QueryParam("u") String url) {
if (!applicationSettingsService.get().isImageProxyEnabled()) {
return Response.status(Status.UNAUTHORIZED).build();
}
url = FeedUtils.imageProxyDecoder(url);
try {
HttpResult result = httpGetter.getBinary(url);