Skip to content

Commit 94d2cde

Browse files
committed
feat(middleware): add extra fields
- Add fields `WantJson`
1 parent 1f3d651 commit 94d2cde

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/middleware/context.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ type Context struct {
1919
RestrictAccess bool
2020
AllowAccess bool
2121

22+
WantJson bool
23+
2224
Status int
2325

2426
Item os.FileInfo

src/serverHandler/middleware.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ func (h *aliasHandler) postMiddleware(w http.ResponseWriter, r *http.Request, da
2424
RestrictAccess: data.RestrictAccess,
2525
AllowAccess: data.AllowAccess,
2626

27+
WantJson: data.WantJson,
28+
2729
Status: data.Status,
2830

2931
Item: data.Item,

0 commit comments

Comments
 (0)