AdguardTeam / AdguardTeam/AdGuardHome

Add some sanity checking and functionality for rewriteAdd and rewriteRemove

Đang mở
#4,585 0 bình luận 0 reaction 1 người được giao Được @ainar-g nhận Xem trên GitHub
enhancement P3: Medium
Ngôn ngữ chính
TypeScript
Star
36.9k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### Prerequisites

Please answer the following questions for yourself before submitting an issue. **YOU MAY DELETE THE PREREQUISITES SECTION.**

- [x] I am running the latest version
- [x] I checked the documentation and found no answer
- [x] I checked to make sure that this issue has not already been filed

### Problem Description

When adding a new rewrite through /control/rewriteAdd it always adds it no matter what. Even if the same domain:answer rule already exists.
Also when removing a rule, /control/rewriteDelete always expects a full domain:answer struct.

### Proposed Solution

It would be much better to do atleast a bit of sanitychecking. Like `if domain:answer exists return "error: already exists"` instead of adding a duplicate rule.
Also a /control/rewriteDelete with only a domain entry should remove all rules that share the domain; no matter the attached "answers". Same goes for /control/rewriteDelete with only a answer. This should delete all rules where the answer matches, no matter the attached domains.
Bonus points if the response of those contains the added/removed entries for clientside sanity checking without the need for additional requests.

- [ ] Add duplicate checking for /control/rewriteAdd (return duplicate error and dont save rule)
- [ ] Return added entries for /control/rewriteAdd

- [ ] Allow requests to /control/rewriteDelete to bulk delete entries for only the specified domain/answer
- [ ] Return deleted entries for /control/rewriteDelete

### Alternatives Considered

### Additional Information

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.