From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
Dominik Csapak <d.csapak@proxmox.com>
Subject: Re: [pve-devel] [PATCH http-server] upload: allow whitespaces in filenames
Date: Fri, 4 Nov 2022 14:17:30 +0100 [thread overview]
Message-ID: <a6d5e38a-b21c-2b82-3a90-7a8d65e458f1@proxmox.com> (raw)
In-Reply-To: <20221104105644.1808000-1-d.csapak@proxmox.com>
Am 04/11/2022 um 11:56 schrieb Dominik Csapak:
> some fields (e.g. filename) can contain spaces, but our 'trim' function,
> would only return the value until the first whitespace character instead
> of removing leading/trailing white space. this lead to giving the wrong
> filename to the api call (e.g. 'foo' instead of 'foo (1).iso') which
> would reject it because of the 'wrong' extension
>
> this patch fixes that by using a more robust regex replacement
>
> fixes commit:
> 0fbcbc2 ("fix #3990: multipart upload: rework to fix uploading small files")
>
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
> while looking at the code, i noticed there is now the unused function
> 'parse_content_disposition', so i'd suggest we either use that instead,
> or remove it if we don't need it
we could also just use the existing PVE::Tools::trim() that does what we
want already?
w.r.t. parse_content_disposition: I'm not really sure if that's the best
fit for the altered "architecture" any more, iow. rather no easy one line
+- change. Maybe it's better to drop it, I found no other usage in our
packages.
prev parent reply other threads:[~2022-11-04 13:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 10:56 Dominik Csapak
2022-11-04 13:17 ` Thomas Lamprecht [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a6d5e38a-b21c-2b82-3a90-7a8d65e458f1@proxmox.com \
--to=t.lamprecht@proxmox.com \
--cc=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal