Miquel Llobet <[email protected]> writes:

> The problem was that parse_content_disposition treated the values
> "filename" and "filename*" as the same and concatenated both values. RFC
> 6266 states that if both are present, "filename*" should have preference.
>
> Now, the patch is tricky, because in this case:
>
> attachment; filename*="A.ext"; filename*0="hello"; filename*1="world.ext",
>
> the final filename should be A.ext.
>
> But modify_param_name in http.c changes the names with '*' to end with the
> first occurrence of '*', this makes it hard to differentiate both cases.
> Instead of fixing this and dealing with lots of edge cases I just check for
> the name to be "filename", end with "*" and have the next character not to
> be a digit. Do you think this is fine or it's best to get modify_param_name
> to do it's job better?
>
> I also added more unit tests to account for the edge cases.

thanks for your contribution, I am having some problems trying to apply
your patch using git: "fatal: corrupt patch at line 49".  Could you
please verify if it was generated correctly?

Thanks,
Giuseppe

Reply via email to