Skip to content

Commit c7e8d86

Browse files
committed
get rid of chi and tollbooth
1 parent 06e6728 commit c7e8d86

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+559
-9168
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/setup-go@v5
1616
with:
1717
cache-dependency-path: backend/
18-
go-version: "1.22"
18+
go-version: "1.23"
1919
id: go
2020

2121
- name: launch mongodb

backend/go.mod

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
module github.com/ukeeper/ukeeper-redabilty/backend
22

3-
go 1.22
4-
toolchain go1.24.1
3+
go 1.23.0
4+
5+
toolchain go1.24.2
56

67
require (
78
github.com/PuerkitoBio/goquery v1.10.2
8-
github.com/didip/tollbooth/v7 v7.0.2
9-
github.com/didip/tollbooth_chi v0.0.0-20220719025231-d662a7f6928f
10-
github.com/go-chi/chi/v5 v5.2.1
11-
github.com/go-chi/render v1.0.3
129
github.com/go-pkgz/lgr v0.12.0
1310
github.com/go-pkgz/rest v1.20.3
11+
github.com/go-pkgz/routegroup v1.3.1
1412
github.com/jessevdk/go-flags v1.6.1
1513
github.com/kennygrant/sanitize v1.2.4
1614
github.com/mauidude/go-readability v0.0.0-20220221173116-a9b3620098b7
@@ -20,10 +18,8 @@ require (
2018
)
2119

2220
require (
23-
github.com/ajg/form v1.5.1 // indirect
2421
github.com/andybalholm/cascadia v1.3.3 // indirect
2522
github.com/davecgh/go-spew v1.1.1 // indirect
26-
github.com/go-pkgz/expirable-cache/v3 v3.0.0 // indirect
2723
github.com/golang/snappy v0.0.4 // indirect
2824
github.com/klauspost/compress v1.17.8 // indirect
2925
github.com/montanaflynn/stats v0.7.1 // indirect

backend/go.sum

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE
1717
github.com/PuerkitoBio/goquery v1.6.0/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
1818
github.com/PuerkitoBio/goquery v1.10.2 h1:7fh2BdHcG6VFZsK7toXBT/Bh1z5Wmy8Q9MV9HqT2AM8=
1919
github.com/PuerkitoBio/goquery v1.10.2/go.mod h1:0guWGjcLu9AYC7C1GHnpysHy056u9aEkUHwhdnePMCU=
20-
github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU=
21-
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
2220
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
2321
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
2422
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
@@ -45,29 +43,19 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
4543
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4644
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
4745
github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
48-
github.com/didip/tollbooth/v7 v7.0.0/go.mod h1:VZhDSGl5bDSPj4wPsih3PFa4Uh9Ghv8hgacaTm5PRT4=
49-
github.com/didip/tollbooth/v7 v7.0.2 h1:WYEfusYI6g64cN0qbZgekDrYfuYBZjUZd5+RlWi69p4=
50-
github.com/didip/tollbooth/v7 v7.0.2/go.mod h1:RtRYfEmFGX70+ike5kSndSvLtQ3+F2EAmTI4Un/VXNc=
51-
github.com/didip/tollbooth_chi v0.0.0-20220719025231-d662a7f6928f h1:jtKwihcLmUC9BAhoJ9adCUqdSSZcOdH2KL7mPTUm2aw=
52-
github.com/didip/tollbooth_chi v0.0.0-20220719025231-d662a7f6928f/go.mod h1:q9C80dnsuVRP2dAskjnXRNWdUJqtGgwG9wNrzt0019s=
5346
github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
5447
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
5548
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
56-
github.com/go-chi/chi/v5 v5.2.1 h1:KOIHODQj58PmL80G2Eak4WdvUzjSJSm0vG72crDCqb8=
57-
github.com/go-chi/chi/v5 v5.2.1/go.mod h1:L2yAIGWB3H+phAw1NxKwWM+7eUH/lU8pOMm5hHcoops=
58-
github.com/go-chi/render v1.0.3 h1:AsXqd2a1/INaIfUSKq3G5uA8weYx20FOsM7uSoCyyt4=
59-
github.com/go-chi/render v1.0.3/go.mod h1:/gr3hVkmYR0YlEy3LxCuVRFzEu9Ruok+gFqbIofjao0=
6049
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
6150
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
6251
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
6352
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
64-
github.com/go-pkgz/expirable-cache v0.1.0/go.mod h1:GTrEl0X+q0mPNqN6dtcQXksACnzCBQ5k/k1SwXJsZKs=
65-
github.com/go-pkgz/expirable-cache/v3 v3.0.0 h1:u3/gcu3sabLYiTCevoRKv+WzjIn5oo7P8XtiXBeRDLw=
66-
github.com/go-pkgz/expirable-cache/v3 v3.0.0/go.mod h1:2OQiDyEGQalYecLWmXprm3maPXeVb5/6/X7yRPYTzec=
6753
github.com/go-pkgz/lgr v0.12.0 h1:uoSCLdiMocZDa+L66DavHG5UIkOJvWKOVqt6sNQllw0=
6854
github.com/go-pkgz/lgr v0.12.0/go.mod h1:A4AxjOthFVFK6jRnVYMeusno5SeDAxcLVHd0kI/lN/Y=
6955
github.com/go-pkgz/rest v1.20.3 h1:oGGfM8XTnvwek29q1OAhcI1nkKKOpurRFApBiYH44Fk=
7056
github.com/go-pkgz/rest v1.20.3/go.mod h1:NC2xNN/y1rIs0PY13FowKoH8rk9RhJNJ0tTbkBg8Yks=
57+
github.com/go-pkgz/routegroup v1.3.1 h1:XAVWskX8Iup6HoQD9zv+gJx4DOJC2DSkKBHCMeeW8/s=
58+
github.com/go-pkgz/routegroup v1.3.1/go.mod h1:kDDPDRLRiRY1vnENrZJw1jQAzQX7fvsbsHGRQFNQfKc=
7159
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
7260
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
7361
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
@@ -112,10 +100,7 @@ github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b
112100
github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
113101
github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90=
114102
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
115-
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
116103
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
117-
github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k=
118-
github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM=
119104
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
120105
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
121106
github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ=
@@ -201,7 +186,6 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
201186
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
202187
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
203188
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
204-
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
205189
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
206190
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
207191
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
@@ -409,7 +393,6 @@ gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bl
409393
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
410394
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
411395
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
412-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
413396
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
414397
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
415398
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=

backend/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ func main() {
3434
if _, err := flags.Parse(&opts); err != nil {
3535
os.Exit(1)
3636
}
37-
// Setup logging
3837
var options []log.Option
3938
if opts.Debug {
4039
options = []log.Option{log.Debug, log.CallerFile}

backend/rest/server.go

Lines changed: 37 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@ import (
1212
"strings"
1313
"time"
1414

15-
"github.com/didip/tollbooth/v7"
16-
"github.com/didip/tollbooth_chi"
17-
"github.com/go-chi/chi/v5"
18-
"github.com/go-chi/chi/v5/middleware"
19-
"github.com/go-chi/render"
2015
log "github.com/go-pkgz/lgr"
2116
"github.com/go-pkgz/rest"
2217
"github.com/go-pkgz/rest/logger"
18+
"github.com/go-pkgz/routegroup"
2319
"go.mongodb.org/mongo-driver/bson/primitive"
2420

2521
"github.com/ukeeper/ukeeper-redabilty/backend/datastore"
@@ -67,42 +63,36 @@ func (s *Server) Run(ctx context.Context, address string, port int, frontendDir
6763
log.Printf("[WARN] http server terminated, %s", httpServer.ListenAndServe())
6864
}
6965

70-
func (s *Server) routes(frontendDir string) chi.Router {
71-
router := chi.NewRouter()
66+
func (s *Server) routes(frontendDir string) http.Handler {
67+
router := routegroup.New(http.NewServeMux())
7268

73-
router.Use(middleware.RequestID, middleware.RealIP, rest.Recoverer(log.Default()))
74-
router.Use(middleware.Throttle(1000), middleware.Timeout(60*time.Second))
69+
router.Use(rest.Recoverer(log.Default()))
70+
router.Use(rest.RealIP)
7571
router.Use(rest.AppInfo("ureadability", "Umputun", s.Version), rest.Ping)
76-
router.Use(tollbooth_chi.LimitHandler(tollbooth.NewLimiter(50, nil)))
77-
72+
router.Use(rest.Throttle(50))
7873
router.Use(logger.New(logger.Log(log.Default()), logger.WithBody, logger.Prefix("[INFO]")).Handler)
7974

80-
router.Route("/api", func(r chi.Router) {
81-
r.Get("/content/v1/parser", s.extractArticleEmulateReadability)
82-
r.Post("/extract", s.extractArticle)
83-
r.Post("/auth", s.authFake)
84-
85-
r.Group(func(protected chi.Router) {
86-
protected.Use(basicAuth("ureadability", s.Credentials))
87-
protected.Post("/rule", s.saveRule)
88-
protected.Post("/toggle-rule/{id}", s.toggleRule)
89-
protected.Post("/preview", s.handlePreview)
75+
router.Route(func(api *routegroup.Bundle) {
76+
api.Mount("/api").Route(func(api *routegroup.Bundle) {
77+
api.HandleFunc("GET /content/v1/parser", s.extractArticleEmulateReadability)
78+
api.HandleFunc("POST /extract", s.extractArticle)
79+
api.HandleFunc("POST /auth", s.authFake)
80+
81+
// add protected group with its own set of middlewares
82+
protectedGroup := api.Group()
83+
protectedGroup.Use(basicAuth("ureadability", s.Credentials))
84+
protectedGroup.HandleFunc("POST /rule", s.saveRule)
85+
protectedGroup.HandleFunc("POST /toggle-rule/{id}", s.toggleRule)
86+
protectedGroup.HandleFunc("POST /preview", s.handlePreview)
9087
})
9188
})
9289

93-
router.Get("/", s.handleIndex)
94-
router.Get("/add/", s.handleAdd)
95-
router.Get("/edit/{id}", s.handleEdit)
90+
router.HandleFunc("GET /", s.handleIndex)
91+
router.HandleFunc("GET /add/", s.handleAdd)
92+
router.HandleFunc("GET /edit/{id}", s.handleEdit)
9693

9794
_ = os.Mkdir(filepath.Join(frontendDir, "static"), 0o700)
98-
fs, err := rest.NewFileServer("/", filepath.Join(frontendDir, "static"), rest.FsOptSPA)
99-
if err != nil {
100-
log.Printf("[ERROR] unable to create file server, %v", err)
101-
return nil
102-
}
103-
router.Get("/*", func(w http.ResponseWriter, r *http.Request) {
104-
fs.ServeHTTP(w, r)
105-
})
95+
router.HandleFiles("/", http.Dir(filepath.Join(frontendDir, "static")))
10696
return router
10797
}
10898

@@ -140,7 +130,7 @@ func (s *Server) handleAdd(w http.ResponseWriter, _ *http.Request) {
140130
}
141131

142132
func (s *Server) handleEdit(w http.ResponseWriter, r *http.Request) {
143-
id := getBid(chi.URLParam(r, "id"))
133+
id := getBid(r.PathValue("id"))
144134
rule, found := s.Readability.Rules.GetByID(r.Context(), id)
145135
if !found {
146136
http.Error(w, "Rule not found", http.StatusNotFound)
@@ -163,59 +153,52 @@ func (s *Server) handleEdit(w http.ResponseWriter, r *http.Request) {
163153

164154
func (s *Server) extractArticle(w http.ResponseWriter, r *http.Request) {
165155
artRequest := extractor.Response{}
166-
if err := render.DecodeJSON(r.Body, &artRequest); err != nil {
167-
render.Status(r, http.StatusInternalServerError)
168-
render.JSON(w, r, JSON{"error": err.Error()})
156+
if err := rest.DecodeJSON(r, &artRequest); err != nil {
157+
rest.SendErrorJSON(w, r, log.Default(), http.StatusInternalServerError, err, "can't parse request")
169158
return
170159
}
171160

172161
if artRequest.URL == "" {
173-
render.Status(r, http.StatusBadRequest)
174-
render.JSON(w, r, JSON{"error": "url parameter is required"})
162+
rest.SendErrorJSON(w, r, log.Default(), http.StatusBadRequest, nil, "url parameter is required")
175163
return
176164
}
177165

178166
res, err := s.Readability.Extract(r.Context(), artRequest.URL)
179167
if err != nil {
180-
render.Status(r, http.StatusBadRequest)
181-
render.JSON(w, r, JSON{"error": err.Error()})
168+
rest.SendErrorJSON(w, r, log.Default(), http.StatusBadRequest, err, "can't extract content")
182169
return
183170
}
184171

185-
render.JSON(w, r, &res)
172+
rest.RenderJSON(w, &res)
186173
}
187174

188175
// extractArticleEmulateReadability emulates readability API parse - https://www.readability.com/api/content/v1/parser?token=%s&url=%s
189176
// if token is not set for application, it won't be checked
190177
func (s *Server) extractArticleEmulateReadability(w http.ResponseWriter, r *http.Request) {
191178
token := r.URL.Query().Get("token")
192179
if s.Token != "" && token == "" {
193-
render.Status(r, http.StatusExpectationFailed)
194-
render.JSON(w, r, JSON{"error": "no token passed"})
180+
rest.SendErrorJSON(w, r, log.Default(), http.StatusExpectationFailed, nil, "no token passed")
195181
return
196182
}
197183

198184
if s.Token != "" && s.Token != token {
199-
render.Status(r, http.StatusUnauthorized)
200-
render.JSON(w, r, JSON{"error": "wrong token passed"})
185+
rest.SendErrorJSON(w, r, log.Default(), http.StatusUnauthorized, nil, "wrong token passed")
201186
return
202187
}
203188

204189
extractURL := r.URL.Query().Get("url")
205190
if extractURL == "" {
206-
render.Status(r, http.StatusExpectationFailed)
207-
render.JSON(w, r, JSON{"error": "no url passed"})
191+
rest.SendErrorJSON(w, r, log.Default(), http.StatusExpectationFailed, nil, "no url passed")
208192
return
209193
}
210194

211195
res, err := s.Readability.Extract(r.Context(), extractURL)
212196
if err != nil {
213-
render.Status(r, http.StatusBadRequest)
214-
render.JSON(w, r, JSON{"error": err.Error()})
197+
rest.SendErrorJSON(w, r, log.Default(), http.StatusBadRequest, err, "can't extract content")
215198
return
216199
}
217200

218-
render.JSON(w, r, &res)
201+
rest.RenderJSON(w, &res)
219202
}
220203

221204
// generates previews for the provided test URLs
@@ -322,11 +305,11 @@ func (s *Server) saveRule(w http.ResponseWriter, r *http.Request) {
322305
}
323306

324307
w.Header().Set("HX-Redirect", "/")
325-
render.JSON(w, r, &srule)
308+
rest.RenderJSON(w, &srule)
326309
}
327310

328311
func (s *Server) toggleRule(w http.ResponseWriter, r *http.Request) {
329-
id := getBid(chi.URLParam(r, "id"))
312+
id := getBid(r.PathValue("id"))
330313
rule, found := s.Readability.Rules.GetByID(r.Context(), id)
331314
if !found {
332315
log.Printf("[WARN] rule not found for id: %s", id.Hex())
@@ -356,9 +339,9 @@ func (s *Server) toggleRule(w http.ResponseWriter, r *http.Request) {
356339
}
357340

358341
// authFake just a dummy post request used for external check for protected resource
359-
func (s *Server) authFake(w http.ResponseWriter, r *http.Request) {
342+
func (s *Server) authFake(w http.ResponseWriter, _ *http.Request) {
360343
t := time.Now()
361-
render.JSON(w, r, JSON{"pong": t.Format("20060102150405")})
344+
rest.RenderJSON(w, JSON{"pong": t.Format("20060102150405")})
362345
}
363346

364347
func getBid(id string) primitive.ObjectID {

backend/rest/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func TestServer_RuleUnhappyFlow(t *testing.T) {
312312

313313
// get supposed to fail
314314
_, code := get(t, ts.URL+"/api/rule")
315-
assert.Equal(t, http.StatusMethodNotAllowed, code)
315+
assert.Equal(t, http.StatusNotFound, code)
316316

317317
// get rule by non-existent ID
318318
_, code = get(t, ts.URL+"/api/rule/nonexistent")

backend/vendor/github.com/ajg/form/.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

backend/vendor/github.com/ajg/form/LICENSE

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)