Skip to content

Commit cb16812

Browse files
update CHANGELOG
1 parent 950c69b commit cb16812

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
9+
### Added
10+
- Added configurable file contents size limit (`SCANOSS_FILE_CONTENTS_LIMIT`).
11+
- Limits the maximum file size returned by the `file_contents` endpoint (default: 50 MB).
12+
- Returns HTTP 400 when the file exceeds the configured limit.
913

1014
## [1.6.5] - 2026-03-26
1115
### Fixed

pkg/service/filecontents_service.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ func (s APIService) FileContents(w http.ResponseWriter, r *http.Request) {
8383
return
8484
}
8585
limitBytes := s.config.Scanning.FileContentsLimit * 1024 * 1024
86+
//unlimited for FileContentsLimit <= 0
8687
if limitBytes > 0 && int64(len(output)) > limitBytes {
8788
zs.Warnf("File contents size %d bytes exceeds limit %d MB for md5 %s", len(output), s.config.Scanning.FileContentsLimit, md5)
8889
w.Header().Set(ContentTypeKey, ApplicationJSON)

0 commit comments

Comments
 (0)