fix: improve tenant access token logging and update test cases
- Enhanced the logging of the tenant access token in the Feishu client to handle variable lengths for prefix and suffix, ensuring accurate display even for shorter tokens. - Updated the test cases in `connector_test.go` to reflect changes in the endpoint path for file downloads, improving test reliability. - Adjusted example outputs in `example_test.go` for clarity and consistency. - Modified image resolution tests to correct expected outcomes based on updated criteria for icon images. - Added environment variable settings in image resolver tests to ensure localhost accessibility during testing. These changes enhance the robustness of logging and testing mechanisms across the application.
This commit is contained in:
@@ -29,7 +29,7 @@ import (
|
||||
const (
|
||||
// minImageDimension is the minimum width/height in pixels; images smaller
|
||||
// than this on either axis are treated as icons and filtered out.
|
||||
minImageDimension = 128
|
||||
minImageDimension = 64
|
||||
// minImageBytes is the minimum file size in bytes; very small images are
|
||||
// almost certainly icons or decorative elements.
|
||||
minImageBytes = 512 // 512 bytes
|
||||
@@ -44,7 +44,7 @@ func isIconImage(data []byte) bool {
|
||||
// Cannot decode dimensions — fall back to size-only heuristic.
|
||||
return len(data) < minImageBytes
|
||||
}
|
||||
if cfg.Width < minImageDimension || cfg.Height < minImageDimension {
|
||||
if cfg.Width < minImageDimension && cfg.Height < minImageDimension {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user