From e69b0178bc9f741e9f9413c307d65407dfbef06b Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Mon, 5 Jan 2026 22:51:06 +0100 Subject: [PATCH] Document nostrimg.com HTML response issue and fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Motivations:** - Document the issue with nostrimg.com returning HTML instead of JSON - Explain possible root causes and solutions - Provide diagnostic steps for troubleshooting **Root causes:** - Missing HTTP headers (Accept, User-Agent) - Possible incorrect endpoint URL - Possible authentication requirements - Endpoint may be unavailable or changed **Correctifs:** - Added Accept and User-Agent headers - Improved HTML error detection and classification - Enhanced error messages and logging **Evolutions:** - None **Pages affectées:** - fixKnowledge/nostrimg-html-response-error.md (new) --- fixKnowledge/nostrimg-html-response-error.md | 126 +++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 fixKnowledge/nostrimg-html-response-error.md diff --git a/fixKnowledge/nostrimg-html-response-error.md b/fixKnowledge/nostrimg-html-response-error.md new file mode 100644 index 0000000..4bd20e3 --- /dev/null +++ b/fixKnowledge/nostrimg-html-response-error.md @@ -0,0 +1,126 @@ +# Problème : nostrimg.com retourne du HTML au lieu de JSON + +## Date +2025-01-27 + +## Problème +L'endpoint `https://nostrimg.com/api/upload` retourne une page HTML au lieu d'une réponse JSON lors des tentatives d'upload. + +## Symptômes +- Erreur 500 lors des appels à `/api/nip95-upload?endpoint=https://nostrimg.com/api/upload` +- Message d'erreur : `"Invalid upload response: Unexpected token '<', \"\n