Skip to content

fix(http): harden requests and resource cleanup - #62

Merged
ekalinin merged 1 commit into
masterfrom
fix/http-resource-lifecycle
Jul 31, 2026
Merged

fix(http): harden requests and resource cleanup#62
ekalinin merged 1 commit into
masterfrom
fix/http-resource-lifecycle

Conversation

@ekalinin

Copy link
Copy Markdown
Owner

Summary

  • inject one HTTP client with a finite timeout into remote GET and POST adapters
  • accept only 2xx responses and return typed status errors with bounded body fragments
  • limit successful response bodies and validate response media types
  • stream POST bodies from files instead of buffering them in memory
  • close and remove remote Markdown and stdin temporary files on success and failure
  • write debug JSON directly to a single retained artifact

Checks

  • go test -count=1 ./...
  • go test -race -count=1 ./...
  • GOTOOLCHAIN=go1.21.13 go test ./...
  • go vet ./...
  • golangci-lint run
  • go mod tidy -diff

@ekalinin
ekalinin merged commit 590ee6d into master Jul 31, 2026
4 checks passed
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.92481% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.31%. Comparing base (4d9bf98) to head (7c0bf07).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
internal/utils/utils.go 60.97% 11 Missing and 5 partials ⚠️
internal/controller/stdin.go 41.17% 6 Missing and 4 partials ⚠️
internal/core/usecase/remotehtml/remotehtml.go 78.57% 3 Missing and 3 partials ⚠️
internal/core/usecase/remotemd/remotemd.go 75.00% 3 Missing and 3 partials ⚠️
internal/core/usecase/new.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #62      +/-   ##
==========================================
+ Coverage   79.13%   79.31%   +0.18%     
==========================================
  Files          27       28       +1     
  Lines         623      701      +78     
==========================================
+ Hits          493      556      +63     
- Misses        100      101       +1     
- Partials       30       44      +14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant