412 blocked content #428

Merged
bones7242 merged 13 commits from 412-blocked_content into master 2018-05-01 01:07:59 +02:00
bones7242 commented 2018-04-30 00:56:32 +02:00 (Migrated from github.com)
  • organized route handlers and controllers
  • added model for blocked claims list
  • added api endpoint to trigger update of blocked claims list
  • added check when serving content for whether content is blocked
- organized route handlers and controllers - added model for blocked claims list - added api endpoint to trigger update of blocked claims list - added check when serving content for whether content is blocked
neb-b (Migrated from github.com) approved these changes 2018-04-30 22:31:20 +02:00
neb-b (Migrated from github.com) commented 2018-04-30 05:11:42 +02:00

You could just return an empty array, unless you specifically need xxx[3] === null

You could just return an empty array, unless you specifically need `xxx[3] === null`
@ -0,0 +35,4 @@
name,
outpoint,
};
return db.upsert(db.Blocked, blocked, blocked, 'Blocked')
neb-b (Migrated from github.com) commented 2018-04-30 05:13:48 +02:00

This is probably because I don't understand upsert that well but why blocked, blocked?

This is probably because I don't understand `upsert` that well but why `blocked, blocked`?
bones7242 (Migrated from github.com) reviewed 2018-05-01 00:10:42 +02:00
@ -0,0 +35,4 @@
name,
outpoint,
};
return db.upsert(db.Blocked, blocked, blocked, 'Blocked')
bones7242 (Migrated from github.com) commented 2018-05-01 00:10:42 +02:00

the second argument is the content to insert and the third argument is the conditional for the upsert. So in this case, update/insert the blocked record based on whether that exact blocked record already exists . In this call to upsert it is duplicative to have two separate arguments, but in other uses it is helpful to have search criteria that doesn't match the inserted criteria specifically. I.e. upsert blocked where {claimId: 'abc123...xyz}

the second argument is the content to insert and the third argument is the conditional for the `upsert`. So in this case, update/insert the `blocked` record based on whether that exact `blocked` record already exists . In this call to `upsert` it is duplicative to have two separate arguments, but in other uses it is helpful to have search criteria that doesn't match the inserted criteria specifically. I.e. upsert `blocked` where `{claimId: 'abc123...xyz}`
kauffj commented 2018-05-01 00:13:21 +02:00 (Migrated from github.com)

@billbitt I didn't read this PR yet, but can you please return code HTTP status code 451 for DMCA pages?

https://en.wikipedia.org/wiki/HTTP_451

@billbitt I didn't read this PR yet, but can you please return code HTTP status code 451 for DMCA pages? https://en.wikipedia.org/wiki/HTTP_451
bones7242 commented 2018-05-01 00:35:26 +02:00 (Migrated from github.com)

@kauffj will do. I had it as 410, but will update to 451.

@kauffj will do. I had it as 410, but will update to 451.
bones7242 (Migrated from github.com) reviewed 2018-05-01 01:07:46 +02:00
bones7242 (Migrated from github.com) commented 2018-05-01 01:07:45 +02:00

good catch. I updated so any specific errors will get thrown (like NO_CHANNEL), like I did with the claims controllers. That streamlines this chain a lot better.

good catch. I updated so any specific errors will get thrown (like `NO_CHANNEL`), like I did with the claims controllers. That streamlines this chain a lot better.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/spee.ch#428
No description provided.