gitea/modules
Copilot a3cc34472b
Pass ServeHeaderOptions by value instead of pointer, fine tune httplib tests (#36982)
Pass `ServeHeaderOptions` by value instead of pointer across all call
sites — no nil-check semantics are needed and the struct is small enough
that copying is fine.

## Changes

- **`services/context/base.go`**: `SetServeHeaders` and `ServeContent`
accept `ServeHeaderOptions` (value, not pointer); internal unsafe
pointer cast replaced with a clean type conversion
- **`routers/api/packages/helper/helper.go`**: `ServePackageFile`
variadic changed from `...*context.ServeHeaderOptions` to
`...context.ServeHeaderOptions`; internal variable is now a value type
- **All call sites** (13 files): `&context.ServeHeaderOptions{...}` →
`context.ServeHeaderOptions{...}`

Before/after at the definition level:
```go
// Before
func (b *Base) SetServeHeaders(opt *ServeHeaderOptions) { ... }
func (b *Base) ServeContent(r io.ReadSeeker, opts *ServeHeaderOptions) { ... }
func ServePackageFile(..., forceOpts ...*context.ServeHeaderOptions) { ... }

// After
func (b *Base) SetServeHeaders(opts ServeHeaderOptions) { ... }
func (b *Base) ServeContent(r io.ReadSeeker, opts ServeHeaderOptions) { ... }
func ServePackageFile(..., forceOpts ...context.ServeHeaderOptions) { ... }
```

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: wxiaoguang <2114189+wxiaoguang@users.noreply.github.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2026-03-25 16:07:59 -07:00
..
actions Feature non-zipped actions artifacts (action v7) (#36786) 2026-03-26 00:37:48 +08:00
analyze Fix incorrect vendored detections (#36508) 2026-02-01 10:35:51 +00:00
assetfs Refactor avatar package, support default avatar fallback (#36788) 2026-03-01 13:32:35 +00:00
auth Correct spelling (#36783) 2026-02-28 11:23:20 -08:00
avatar Refactor avatar package, support default avatar fallback (#36788) 2026-03-01 13:32:35 +00:00
badge
base Fix incorrect setting loading order (#36735) 2026-02-24 23:46:08 +08:00
cache
cachegroup
charset Fix CodeQL code scanning alerts (#36858) 2026-03-08 14:35:50 +00:00
commitstatus
container
csv
dump
emoji Update emoji data for Unicode 16 (#36596) 2026-02-12 21:39:36 +00:00
eventsource Add more check for stopwatch read or list (#36340) 2026-01-13 13:13:39 +00:00
fileicon Add FOLDER_ICON_THEME configuration option (#36496) 2026-01-30 20:48:56 +00:00
generate
git Add a git grep search timeout (#36809) 2026-03-04 12:11:42 -08:00
gitrepo Clean up Makefile, tests and legacy code (#36638) 2026-02-19 01:23:32 +00:00
glob
globallock
graceful Enable `nilnil` linter for new code (#36591) 2026-02-16 09:57:18 +00:00
gtprof
hcaptcha Clean up Makefile, tests and legacy code (#36638) 2026-02-19 01:23:32 +00:00
highlight Fix chroma lexer mapping (#36629) 2026-02-16 02:11:02 +00:00
hostmatcher
htmlutil Fix markup heading parsing, fix emphasis parsing (#36284) 2026-01-23 20:24:58 +00:00
httpcache Refactor avatar package, support default avatar fallback (#36788) 2026-03-01 13:32:35 +00:00
httplib Pass ServeHeaderOptions by value instead of pointer, fine tune httplib tests (#36982) 2026-03-25 16:07:59 -07:00
indexer Fix typos in code comments: doesnt, dont, wont (#36890) 2026-03-13 09:58:44 -07:00
issue/template Limit reading bytes instead of ReadAll (#35928) 2025-11-12 19:44:49 +08:00
json
label
lfs Feature non-zipped actions artifacts (action v7) (#36786) 2026-03-26 00:37:48 +08:00
lfstransfer Correct spelling (#36783) 2026-02-28 11:23:20 -08:00
log Refactor git command context & pipeline (#36406) 2026-01-21 01:35:14 +00:00
markup Fix various trivial problems (#36921) 2026-03-19 07:13:55 +08:00
mcaptcha
metrics
migration fix: prevent panic when GitLab release has more links than sources (#36295) 2026-01-05 21:48:12 +08:00
nosql Refactor git command context & pipeline (#36406) 2026-01-21 01:35:14 +00:00
optional Fix API not persisting pull request unit config when has_pull_requests is not set (#36718) 2026-03-02 22:08:53 +00:00
options
packages Refactor storage content-type handling of ServeDirectURL (#36804) 2026-03-21 21:26:13 -07:00
paginator
pprof
private feat: Add configurable permissions for Actions automatic tokens (#36173) 2026-03-21 15:39:47 -07:00
process Refactor git command context & pipeline (#36406) 2026-01-21 01:35:14 +00:00
proxy
proxyprotocol
public Refactor storage content-type handling of ServeDirectURL (#36804) 2026-03-21 21:26:13 -07:00
queue Refactor git command context & pipeline (#36406) 2026-01-21 01:35:14 +00:00
recaptcha Fix URLJoin, markup render link reoslving, sign-in/up/linkaccount page common data (#36861) 2026-03-08 15:57:37 +00:00
references Support closing keywords with URL references (#36221) 2025-12-27 09:05:24 -08:00
regexplru
repository feat: Add configurable permissions for Actions automatic tokens (#36173) 2026-03-21 15:39:47 -07:00
reqctx
secret
session Clean up Makefile, tests and legacy code (#36638) 2026-02-19 01:23:32 +00:00
setting Make PUBLIC_URL_DETECTION default to "auto" (#36955) 2026-03-23 23:19:08 +00:00
sitemap
ssh
storage Feature non-zipped actions artifacts (action v7) (#36786) 2026-03-26 00:37:48 +08:00
structs Fix org contact email not clearable once set (#36975) 2026-03-25 15:23:11 +08:00
svg Add render cache for SVG icons (#36863) 2026-03-10 05:26:16 +00:00
system
tailmsg
tempdir
templates Fix URLJoin, markup render link reoslving, sign-in/up/linkaccount page common data (#36861) 2026-03-08 15:57:37 +00:00
test Require additional user confirmation for making repo private (#36959) 2026-03-24 20:13:08 +00:00
testlogger Clean up Makefile, tests and legacy code (#36638) 2026-02-19 01:23:32 +00:00
timeutil Clean up Makefile, tests and legacy code (#36638) 2026-02-19 01:23:32 +00:00
translation Fix various trivial problems (#36953) 2026-03-23 18:23:42 +00:00
turnstile
typesniffer Feature non-zipped actions artifacts (action v7) (#36786) 2026-03-26 00:37:48 +08:00
updatechecker
uri
user
util feat: Add configurable permissions for Actions automatic tokens (#36173) 2026-03-21 15:39:47 -07:00
validation Add user badges (#36752) 2026-03-22 15:49:45 +00:00
web Add user badges (#36752) 2026-03-22 15:49:45 +00:00
webhook actions: report commit status for pull_request_review events (#36589) 2026-02-20 16:12:22 +00:00
zstd