Page MenuHomePhabricator

Support file attachments on HTTPSFuture
ClosedPublic

Authored by epriestley on Apr 21 2014, 6:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 18, 5:10 AM
Unknown Object (File)
Sun, Nov 17, 7:22 PM
Unknown Object (File)
Sat, Nov 16, 5:51 PM
Unknown Object (File)
Thu, Nov 14, 12:15 AM
Unknown Object (File)
Sat, Nov 9, 7:48 PM
Unknown Object (File)
Wed, Oct 23, 3:50 AM
Unknown Object (File)
Oct 20 2024, 5:07 AM
Unknown Object (File)
Oct 16 2024, 9:42 PM
Subscribers

Details

Summary

@zeeg wants this for some build stuff and we'd like it in general to make Mailgun work better. It's a bit messy because of how cURL works. See pages of comments inline.

Test Plan
  • Added tests for the parser stuff.
  • Made various requests with and without file attachments and saw them encode data as expected.
  • Made some dangerous requests (with "@") and saw them fail.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

epriestley retitled this revision from to Support file attachments on HTTPSFuture.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
epriestley added a subscriber: zeeg.
  • Handle mime types and file names; use CURLFile if available.
btrahan edited edge metadata.

Are we locked into supporting certain PHP versions? Diff had me wondering.

This revision is now accepted and ready to land.Apr 21 2014, 9:26 PM

We don't formally support PHP before 5.2.3, but we don't have a hard kill for earlier versions in libphutil (we do in Phabricator).

I think the major risk here is someone including the library, or copy/pasting the code, or using it as a reference to implement something similar. In most cases, if you do that and run on an old PHP you get a nonfunctional feature which is broken in an obvious way (e.g., missing function or something like that), but in this case you'd get a gaping security hole. The two lines of cruft feel kind-of-okayish to me given the extreme badness of not doing the check.

epriestley updated this revision to Diff 20961.

Closed by commit rPHU159b5065d9d4 (authored by @epriestley).