mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Merge branch 'master' into offline
* master: Logging favicons usage. Adding ip address to blocked windows devices.
This commit is contained in:
commit
cb3d205dd6
3 changed files with 4 additions and 2 deletions
|
@ -27,7 +27,8 @@ def login(request):
|
|||
|
||||
if not user_agent or user_agent.lower() in ['nativehost']:
|
||||
errors = dict(user_agent="You must set a user agent to login.")
|
||||
logging.user(request, "~FG~BB~SK~FRBlocked ~FGAPI Login~SN~FW: %s" % (user_agent))
|
||||
ip = request.META.get('HTTP_X_REAL_IP', None) or request.META['REMOTE_ADDR']
|
||||
logging.user(request, "~FG~BB~SK~FRBlocked ~FGAPI Login~SN~FW: %s / %s" % (user_agent, ip))
|
||||
elif request.method == "POST":
|
||||
form = LoginForm(data=request.POST)
|
||||
if form.errors:
|
||||
|
|
|
@ -28,7 +28,7 @@ app.get /^\/rss_feeds\/icon\/(\d+)\/?/, (req, res) =>
|
|||
feed_id = parseInt(req.params, 10)
|
||||
etag = req.header('If-None-Match')
|
||||
@collection.findOne _id: feed_id, (err, docs) ->
|
||||
# console.log "Req: #{feed_id}, etag: #{etag}"
|
||||
console.log "Req: #{feed_id}, etag: #{etag}/#{docs.color}"
|
||||
if not err and etag and docs and docs.color == etag
|
||||
res.send 304
|
||||
else if not err and docs and docs.data
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
return _this.collection.findOne({
|
||||
_id: feed_id
|
||||
}, function(err, docs) {
|
||||
console.log("Req: " + feed_id + ", etag: " + etag + "/" + docs.color);
|
||||
if (!err && etag && docs && docs.color === etag) {
|
||||
return res.send(304);
|
||||
} else if (!err && docs && docs.data) {
|
||||
|
|
Loading…
Add table
Reference in a new issue