mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
speed feeds refresh up by using http headers
This commit is contained in:
@@ -20,6 +20,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.commafeed.backend.HttpGetter;
|
||||
import com.commafeed.backend.HttpGetter.HttpResult;
|
||||
import com.commafeed.backend.StartupBean;
|
||||
import com.commafeed.backend.model.UserRole.Role;
|
||||
import com.commafeed.frontend.SecurityCheck;
|
||||
@@ -74,7 +75,10 @@ public class FaviconPage extends BasePage {
|
||||
|
||||
String iconUrl = "http://g.etfv.co/"
|
||||
+ URLEncoder.encode(url, "UTF-8") + "?defaulticon=none";
|
||||
img = getter.getBinary(iconUrl);
|
||||
HttpResult result = getter.getBinary(iconUrl);
|
||||
if (result != null) {
|
||||
img = result.getContent();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.commafeed.frontend.rest.resources;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.Resource;
|
||||
import javax.inject.Inject;
|
||||
import javax.interceptor.AroundInvoke;
|
||||
import javax.interceptor.InvocationContext;
|
||||
|
||||
@@ -21,6 +21,7 @@ import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.commafeed.backend.model.Feed;
|
||||
import com.commafeed.backend.model.FeedCategory;
|
||||
@@ -42,11 +43,11 @@ public class SubscriptionsREST extends AbstractREST {
|
||||
@ApiOperation(value = "Fetch a feed", notes = "Fetch a feed by its url", responseClass = "com.commafeed.backend.model.Feed")
|
||||
public Feed fetchFeed(@QueryParam("url") String url) {
|
||||
Preconditions.checkNotNull(url);
|
||||
|
||||
url = StringUtils.trimToEmpty(url);
|
||||
url = prependHttp(url);
|
||||
Feed feed = null;
|
||||
try {
|
||||
feed = feedFetcher.fetch(url, true);
|
||||
feed = feedFetcher.fetch(url, true, null, null);
|
||||
} catch (Exception e) {
|
||||
throw new WebApplicationException(e, Response
|
||||
.status(Status.INTERNAL_SERVER_ERROR)
|
||||
|
||||
Reference in New Issue
Block a user