Skip to content

Commit 0866b90

Browse files
authored
fix(link): correct link cache mode bitwise comparison (#1635)
* fix(link): correct link cache mode bitwise comparison Signed-off-by: MadDogOwner <[email protected]> * refactor(link): use explicit flag equality for link cache mode bitmask checks Signed-off-by: MadDogOwner <[email protected]> --------- Signed-off-by: MadDogOwner <[email protected]>
1 parent 055696f commit 0866b90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/op/fs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ func Link(ctx context.Context, storage driver.Driver, path string, args model.Li
173173
mode = storage.(driver.LinkCacheModeResolver).ResolveLinkCacheMode(path)
174174
}
175175
typeKey := args.Type
176-
if mode&driver.LinkCacheIP == 1 {
176+
if mode&driver.LinkCacheIP == driver.LinkCacheIP {
177177
typeKey += "/" + args.IP
178178
}
179-
if mode&driver.LinkCacheUA == 1 {
179+
if mode&driver.LinkCacheUA == driver.LinkCacheUA {
180180
typeKey += "/" + args.Header.Get("User-Agent")
181181
}
182182
key := Key(storage, path)

0 commit comments

Comments
 (0)