Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

hey compose to [email protected] publishes the post but reports 406 Not Acceptable (retries create duplicate posts)

Aperta
#556 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
go
Ambito
api, cli

Direzione di ricerca

The payload names no source files. Start by reproducing with hey compose --to [email protected] -v and checking the redirect handling in the Go HTTP client code that sends the compose POST. Decide whether the 302 should count as success or the redirect should not be followed for this send, since the maintainer has not chosen. Done means a successful POST is reported as sent with ok: true, and a test covers the 302-then-406 sequence.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

hey compose to [email protected] (HEY World) publishes the post, but the CLI reports a failure:

{ "ok": false, "error": "API error: 406 Not Acceptable", "code": "api" }

Because the command says it failed, rerunning it publishes the post again. Three runs produced three identical public posts.

Steps to reproduce

hey compose --to [email protected] --subject "Test post" < body.md

Verbose output (-v)

http request method=POST
http response status=302
http request method=GET
http response status=406

The POST succeeds and redirects (302). The CLI follows the redirect with a GET that HEY answers with 406, and then reports the whole send as failed.

Expected

  • Treat the 302 after the POST as success (or do not follow the redirect for this send), and report the post as sent/published.
  • At minimum, do not report ok: false when the message was actually accepted, since scripts and agents will retry it and create duplicates.

Related: an idempotency key for compose (#477) would also prevent duplicate posts.

hey version 1.8.0

Lingua principale
Go
Stelle
409
Fork
49
Merge medio
22h 16m
PR unite (30g)
75

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di basecamp/hey-cli

Tutte le issue di basecamp/hey-cli

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.