-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Don't set "local.path" as a default filename to prevent it from being detected as a binary #69
Comments
Yes, something like this seems reasoanble. I think if the path is not given, we can use nil. We could make it an optional keyword argument. I am open to ideas, and agree the current implementation looks a bit odd. |
@ioquatix Thank you for your response! I've created the most conservative diffs. Is this what you want?
Do you refer to The code I am suggesting is very small. Besides, There's no need to rush. If you have a better idea, please feel free to close this issue without hesitation. It may be the easiest way for you. |
I think we should try to fix the interface. The problem I have with
@Lewiscowles1986 do you have any opinion? |
I would use nil which I read as indeterminate for filename so to avoid reserved (cursed) tokens that are hard to reason about; then internally set if nil. You could also use empty string via String.new as that is an invalid file name. What do you think of this? I believe most network clients like outlook, thunderbird, all the browsers default to attachment.dat |
I welcome a PR for this. |
Thank you for useful gem!
On some systems, a preview of an image is not displayed correctly when I specify "local.path" as a filename. To solve this behavior, could you simply set "file" as a default filename?
If you agree with this issue, I will create a pull request. I would like to know your opinion.
One of those systems is Slack for Mac. Starting at 2021/05/05 05:30 UTC, Slack client no longer correctly displays previews of images when the filename is "local.path".
The relevant code of this issue is here.
https://github.com/socketry/multipart-post/blob/master/lib/multipart/post/composite_read_io.rb#L80-L88
The text was updated successfully, but these errors were encountered: