detached 62d919e

chore: switch purego dependency to bnema/purego fork

Replace local path replace directive with GitHub URL pointing to
bnema/purego@91aa177. Also fix CEF response headers to split
MIME type and charset for correct content-type handling.
commit
62d919ec3bb0fcd598b14dd03bc4f064c08bf673
author
brice · · 2026-03-23 19:51 UTC
committer
brice · · 2026-03-28 04:38 UTC
parent
4da3a75
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
3 files · +25 -3
M go.mod +2 -2
@@ -29,8 +29,6 @@ replace github.com/ebitengine/purego => github.com/bnema/purego v0.0.0-202603230
2929
3030 replace github.com/bnema/purego-cef => ../purego-cef
3131
32-replace github.com/ebitengine/purego => ../purego
33-
3432 require (
3533 github.com/atotto/clipboard v0.1.4 // indirect
3634 github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
@@ -80,3 +78,5 @@ require (
8078 modernc.org/mathutil v1.7.1 // indirect
8179 modernc.org/memory v1.11.0 // indirect
8280 )
81+
82+replace github.com/ebitengine/purego => github.com/bnema/purego v0.0.0-20260323095903-91aa177a2704
@@ -29,8 +29,6 @@ replace github.com/ebitengine/purego => github.com/bnema/purego v0.0.0-202603230
29 29
30 replace github.com/bnema/purego-cef => ../purego-cef30 replace github.com/bnema/purego-cef => ../purego-cef
31 31
32-replace github.com/ebitengine/purego => ../purego
33-
34 require (32 require (
35 github.com/atotto/clipboard v0.1.4 // indirect33 github.com/atotto/clipboard v0.1.4 // indirect
36 github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect34 github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
@@ -80,3 +78,5 @@ require (
80 modernc.org/mathutil v1.7.1 // indirect78 modernc.org/mathutil v1.7.1 // indirect
81 modernc.org/memory v1.11.0 // indirect79 modernc.org/memory v1.11.0 // indirect
82 )80 )
81+
82+replace github.com/ebitengine/purego => github.com/bnema/purego v0.0.0-20260323095903-91aa177a2704
M go.sum +2 -0 generated file: collapsed
M internal/infrastructure/cef/scheme_handler.go +21 -1
@@ -247,6 +247,20 @@ func getMimeType(filename string) string {
247247 }
248248 }
249249
250+// splitMimeCharset splits "text/html; charset=utf-8" into ("text/html", "utf-8").
251+// If no charset parameter is present, charset is empty.
252+func splitMimeCharset(contentType string) (mimeType, charset string) {
253+ parts := strings.SplitN(contentType, ";", 2)
254+ mimeType = strings.TrimSpace(parts[0])
255+ if len(parts) > 1 {
256+ param := strings.TrimSpace(parts[1])
257+ if strings.HasPrefix(strings.ToLower(param), "charset=") {
258+ charset = strings.TrimSpace(param[len("charset="):])
259+ }
260+ }
261+ return
262+}
263+
250264 // ---------------------------------------------------------------------------
251265 // ResourceHandler implementation
252266 // ---------------------------------------------------------------------------
@@ -294,9 +308,15 @@ func (rh *staticResourceHandler) ProcessRequest(_ purecef.Request, _ purecef.Cal
294308 }
295309
296310 // GetResponseHeaders sets status code, MIME type, and content length.
311+// CEF's SetMimeType expects the MIME type without charset parameters;
312+// the charset must be set separately via SetCharset.
297313 func (rh *staticResourceHandler) GetResponseHeaders(response purecef.Response, responseLength unsafe.Pointer, _ uintptr) {
298314 response.SetStatus(int32(rh.statusCode))
299- response.SetMimeType(rh.contentType)
315+ mimeType, charset := splitMimeCharset(rh.contentType)
316+ response.SetMimeType(mimeType)
317+ if charset != "" {
318+ response.SetCharset(charset)
319+ }
300320 *(*int64)(responseLength) = int64(len(rh.data))
301321 }
302322
@@ -247,6 +247,20 @@ func getMimeType(filename string) string {
247 }247 }
248 }248 }
249 249
250+// splitMimeCharset splits "text/html; charset=utf-8" into ("text/html", "utf-8").
251+// If no charset parameter is present, charset is empty.
252+func splitMimeCharset(contentType string) (mimeType, charset string) {
253+ parts := strings.SplitN(contentType, ";", 2)
254+ mimeType = strings.TrimSpace(parts[0])
255+ if len(parts) > 1 {
256+ param := strings.TrimSpace(parts[1])
257+ if strings.HasPrefix(strings.ToLower(param), "charset=") {
258+ charset = strings.TrimSpace(param[len("charset="):])
259+ }
260+ }
261+ return
262+}
263+
250 // ---------------------------------------------------------------------------264 // ---------------------------------------------------------------------------
251 // ResourceHandler implementation265 // ResourceHandler implementation
252 // ---------------------------------------------------------------------------266 // ---------------------------------------------------------------------------
@@ -294,9 +308,15 @@ func (rh *staticResourceHandler) ProcessRequest(_ purecef.Request, _ purecef.Cal
294 }308 }
295 309
296 // GetResponseHeaders sets status code, MIME type, and content length.310 // GetResponseHeaders sets status code, MIME type, and content length.
311+// CEF's SetMimeType expects the MIME type without charset parameters;
312+// the charset must be set separately via SetCharset.
297 func (rh *staticResourceHandler) GetResponseHeaders(response purecef.Response, responseLength unsafe.Pointer, _ uintptr) {313 func (rh *staticResourceHandler) GetResponseHeaders(response purecef.Response, responseLength unsafe.Pointer, _ uintptr) {
298 response.SetStatus(int32(rh.statusCode))314 response.SetStatus(int32(rh.statusCode))
299- response.SetMimeType(rh.contentType)315+ mimeType, charset := splitMimeCharset(rh.contentType)
316+ response.SetMimeType(mimeType)
317+ if charset != "" {
318+ response.SetCharset(charset)
319+ }
300 *(*int64)(responseLength) = int64(len(rh.data))320 *(*int64)(responseLength) = int64(len(rh.data))
301 }321 }
302 322

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close