[mailstream] Remove URL parameters when extracting image filenames #894

Merged
mexon merged 1 commits from mat/mailstream-url-params into develop 2019-09-28 10:37:34 +02:00
mexon commented 2019-09-28 10:18:16 +02:00 (Migrated from github.com)

The filenames used in mailstream sometimes end up looking like "file.jpg?param=123" because I was calling basename on a URL. This version uses parse_url to get rid of the URL paramters.

The filenames used in mailstream sometimes end up looking like "file.jpg?param=123" because I was calling basename on a URL. This version uses parse_url to get rid of the URL paramters.
MrPetovan (Migrated from github.com) reviewed 2019-09-28 10:27:19 +02:00
MrPetovan (Migrated from github.com) left a comment

What if the query string is necessary to display the right image?

What if the query string is necessary to display the right image?
mexon commented 2019-09-28 10:34:48 +02:00 (Migrated from github.com)

The filename used here is just a label, as far as I know only used when saving the file at the other end. It doesn't include the rest of the URL so it's useless for requesting the original image anyway. When mailstream actually does fetch the image, it uses the full URL including query params.

The filename used here is just a label, as far as I know only used when saving the file at the other end. It doesn't include the rest of the URL so it's useless for requesting the original image anyway. When mailstream actually does fetch the image, it uses the full URL including query params.
MrPetovan (Migrated from github.com) approved these changes 2019-09-28 10:37:30 +02:00
Sign in to join this conversation.
No description provided.