Skip to content

feat(http): write headers to disk#3157

Merged
olimorris merged 2 commits into
mainfrom
feat/http-write-headers-to-disk
Jun 13, 2026
Merged

feat(http): write headers to disk#3157
olimorris merged 2 commits into
mainfrom
feat/http-write-headers-to-disk

Conversation

@olimorris

Copy link
Copy Markdown
Owner

Description

Something that has been on my todo list for far too long...prevent users from accidentally copying API keys when they share their logs.

This PR writes headers to a temp file and then shares the path to the file with curl.

AI Usage

Sonnet 4.6

Related Issue(s)

Screenshots

Checklist

  • I've read the contributing guidelines and have adhered to them in this PR
  • I confirm that this PR has been majority created by me, and not AI (unless stated in the "AI Usage" section above)
  • I've run make all to ensure docs are generated, tests pass and StyLua has formatted the code
  • (optional) I've added test coverage for this fix/feature
  • (optional) I've updated the README and/or relevant docs pages

@olimorris olimorris merged commit ffae107 into main Jun 13, 2026
6 checks passed
@olimorris olimorris deleted the feat/http-write-headers-to-disk branch June 13, 2026 09:37
@euri10

euri10 commented Jun 13, 2026

Copy link
Copy Markdown

Something that has been on my todo list for far too long...prevent users from accidentally copying API keys when they share their logs.

the drawback being that now we get sensitive data on file...

2 things I noticed while reading this quickly:

  1. the file is removed only in case log level is info or error, why not the rest ?
  2. plenary will write that file using it's default 0666, so it opens the file as user/group/other readable/writable before umask is applied, maybe forcing it to 600 would be better this said it alleviates readability issues but not leftovers files

@olimorris

olimorris commented Jun 13, 2026

Copy link
Copy Markdown
Owner Author

the drawback being that now we get sensitive data on file...

It was always on file anyway, in the log. The difference is now it's in a temporary location so will be cleaned out by nvim on exit. Or, via the cleanup function at the end of the request

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.

2 participants