fix: sanitize container log output and fix lint issues
- Update nolint comment on log streaming to accurately describe why gosec is suppressed (text/plain Content-Type, not HTML) - Replace <script type="text/plain"> with data attribute for initial logs to prevent </script> breakout from attacker-controlled log data - Move RemoveImage before unexported methods (funcorder) - Fix file permissions in test (gosec G306) - Rename unused parameters in export_test.go (revive) - Add required blank line before assignment (wsl)
This commit is contained in:
parent
e2e270a557
commit
1417a87dff
@ -369,7 +369,7 @@ document.addEventListener("alpine:init", () => {
|
|||||||
init() {
|
init() {
|
||||||
// Read initial logs from script tag (avoids escaping issues)
|
// Read initial logs from script tag (avoids escaping issues)
|
||||||
const initialLogsEl = this.$el.querySelector(".initial-logs");
|
const initialLogsEl = this.$el.querySelector(".initial-logs");
|
||||||
this.logs = initialLogsEl?.textContent || "Loading...";
|
this.logs = initialLogsEl?.dataset.logs || "Loading...";
|
||||||
|
|
||||||
// Set up scroll tracking
|
// Set up scroll tracking
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
|||||||
@ -98,7 +98,7 @@
|
|||||||
title="Scroll to bottom"
|
title="Scroll to bottom"
|
||||||
>↓ Follow</button>
|
>↓ Follow</button>
|
||||||
</div>
|
</div>
|
||||||
{{if .Logs.Valid}}<script type="text/plain" class="initial-logs">{{.Logs.String}}</script>{{end}}
|
{{if .Logs.Valid}}<div hidden class="initial-logs" data-logs="{{.Logs.String}}"></div>{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user