From 8b4cf2297ae6ce4b6efcb733a6b9d5e0029d1f9c Mon Sep 17 00:00:00 2001 From: "Mr. Robot" Date: Mon, 2 Feb 2026 20:00:56 +0600 Subject: [PATCH 1/3] chore: ignore internal HTTP detail --- app/error.vue | 20 ++++++++++++++++++-- app/pages/package/[...package].vue | 5 +---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/error.vue b/app/error.vue index 7bb9ed11d3..6add87db71 100644 --- a/app/error.vue +++ b/app/error.vue @@ -20,6 +20,22 @@ const statusText = computed(() => { } }) +// Sanitize error messages to hide internal details (e.g., HTTP methods, registry URLs) +const sanitizedMessage = computed(() => { + const msg = props.error.message + if (!msg) return null + + // Clean up messages that expose internal HTTP details like: + // [GET] "https://registry.npmjs.org/...": 404 Not Found + // Extract just the status part (e.g., "404 Not Found") + const httpMatch = msg.match(/^\[(GET|POST|PUT|DELETE|PATCH)\]\s+"https?:\/\/[^"]+"\s*:\s*(.+)$/) + if (httpMatch) { + return httpMatch[2] // Return just "404 Not Found" part + } + + return msg +}) + function handleError() { clearError({ redirect: '/' }) } @@ -43,10 +59,10 @@ useHead({

- {{ error.message }} + {{ sanitizedMessage }}