Skip to content

Add content-type input to override auto-detection#11

Merged
jason-rl merged 1 commit intomainfrom
feat/content-type-override
Apr 10, 2026
Merged

Add content-type input to override auto-detection#11
jason-rl merged 1 commit intomainfrom
feat/content-type-override

Conversation

@jason-rl
Copy link
Copy Markdown
Contributor

Summary

  • Add content-type input to action.yml accepting text, binary, gzip, tar, or tgz
  • When provided, overrides the auto-detected content type for file/tar uploads
  • When omitted, behavior is unchanged (auto-detect from extension/content)

Context

.tgz files uploaded via source-type: file were auto-detected as tgz, causing rage to extract them as archives. Public npm agents need content-type: binary so the tarball is placed as a single file for npm install -g ./file.tgz.

Test plan

  • Deploy a file-type agent with content-type: binary and a .tgz file
  • Verify rage places the file as-is (not extracted)
  • Deploy a file-type agent without content-type and verify auto-detection still works

🤖 Generated with Claude Code

@jason-rl jason-rl force-pushed the feat/content-type-override branch from 3d8ea65 to 543b9bc Compare April 10, 2026 23:23
- Add `content-type` input to override auto-detected content type
- Include `unspecified` as a valid value (matches backend/frontend)
- Rewrite `determineContentType` to verify file contents against
  extensions using magic bytes: gzip header (1f 8b), tar header
  (ustar at offset 257), and decompressed tar-inside-gzip check
- Warn when extension doesn't match actual file contents
- Fall back to content-based heuristics when no extension matches

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jason-rl jason-rl force-pushed the feat/content-type-override branch from 543b9bc to 7b4c08e Compare April 10, 2026 23:24
@jason-rl jason-rl merged commit 9270f21 into main Apr 10, 2026
1 check failed
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