fix: add timeout and use HEAD for registry URL validation#2130
fix: add timeout and use HEAD for registry URL validation#2130manja316 wants to merge 1 commit intoasyncapi:masterfrom
Conversation
When --registry-url points to an unreachable host, the CLI hangs indefinitely because fetch() has no timeout and uses GET. This adds: - 5-second timeout via AbortController - HEAD method instead of GET for lightweight validation - Specific error message for timeout vs other network errors Fixes asyncapi#2027 Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
There was a problem hiding this comment.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
|



Summary
AbortControllertoregistryValidation()fetch callGETtoHEADfor lightweight registry reachability checkRoot Cause
fetch()insrc/utils/generate/registry.tshad no timeout and no abort signal, causing the CLI to hang indefinitely when--registry-urlpoints to an unreachable host (e.g., blackholed IP).Test Plan
http://10.255.255.1) — CLI now exits with timeout error after 5sFixes #2027