mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
prevent use of proxy if option is disabled
This commit is contained in:
@@ -34,6 +34,10 @@ public class ServerREST extends AbstractResourceREST {
|
|||||||
@ApiOperation(value = "proxy image")
|
@ApiOperation(value = "proxy image")
|
||||||
@Produces("image/png")
|
@Produces("image/png")
|
||||||
public Response get(@QueryParam("u") String url) {
|
public Response get(@QueryParam("u") String url) {
|
||||||
|
if (!applicationSettingsService.get().isImageProxyEnabled()) {
|
||||||
|
return Response.status(Status.UNAUTHORIZED).build();
|
||||||
|
}
|
||||||
|
|
||||||
url = FeedUtils.imageProxyDecoder(url);
|
url = FeedUtils.imageProxyDecoder(url);
|
||||||
try {
|
try {
|
||||||
HttpResult result = httpGetter.getBinary(url);
|
HttpResult result = httpGetter.getBinary(url);
|
||||||
|
|||||||
Reference in New Issue
Block a user