public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH 0/2] improve error message when accessing a directory
@ 2025-10-15  8:03 Nicolas Frey
  2025-10-15  8:03 ` [pve-devel] [PATCH 1/2] apiserver: fix typo Nicolas Frey
  2025-10-15  8:03 ` [pve-devel] [PATCH 2/2] apiserver: check if file is directory before opening Nicolas Frey
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolas Frey @ 2025-10-15  8:03 UTC (permalink / raw)
  To: pve-devel

I ran into this when I accidentally went to the path /pve-docs/api-viewer
instead of /pve-docs/api-viewer/index.html, where I got this error:

`unable to detect content type at /usr/share/perl5/PVE/APIServer/AnyEvent.pm line 499.`

Which IMO was not very telling of the underlying mistake I had made.
This patch aims to improve this error message by checking if the
queried file is a directory and returning a more descriptive
message to the user.

I'm not sure (since I'm not too familiar with this codebase) if this
breaks any existing functionality I may have missed or was intended
behaviour, though I didn't find anything that would suggest this.

See also: https://perldoc.perl.org/IO::File#NOTE

Nicolas Frey (2):
  apiserver: fix typo
  apiserver: check if file is directory before opening

 src/PVE/APIServer/AnyEvent.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.47.3


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-15  8:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-15  8:03 [pve-devel] [PATCH 0/2] improve error message when accessing a directory Nicolas Frey
2025-10-15  8:03 ` [pve-devel] [PATCH 1/2] apiserver: fix typo Nicolas Frey
2025-10-15  8:03 ` [pve-devel] [PATCH 2/2] apiserver: check if file is directory before opening Nicolas Frey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal