Commit Graph

14 Commits

Author SHA1 Message Date
Bharat Mediratta
34198e71d3 Add a cache buster to all data_rest urls, add caching headers to all
data_rest responses, and check cache validity.  Fixes #1909.
2013-01-23 20:50:54 -05:00
shadlaws
8436e16b2f #1954 - Skip buffer calls for unit tests of file_proxy and data_rest.
Moved the "if (TEST_MODE)" statement before the buffer calls in file_proxy and data_rest.
This has no impact on normal use, but will make the unit tests more compatible with different server/PHP configurations.
Note: We do not have to skip setting the headers, which means we can build unit tests around them if we wish.
2013-01-21 10:45:34 +01:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
8dc34dade8 Add unit tests for data_rest. While I'm in there, get rid of the
clause that returns nothing when the album has no album cover - we'll
fail before that if the album's thumbnail is missing, and if it's not
missing then we'll have something to serve even if it's out of date.
2013-01-21 00:52:52 -05:00
shadlaws
1927dd00e4 #1949 - Fix album thumb mime types given by data_rest and file_proxy
Correct result: always "image/jpeg"
Old data_rest result: mime of cover item
Old file_proxy result: mime of album item (null)
2013-01-20 08:34:12 +01:00
shadlaws
592eff0e5a #1942 - Make data_rest and file_proxy more consistent - several minor documentation/formatting changes.
No actual functionality changed here.
2013-01-19 08:40:19 +01:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Bharat Mediratta
ef8751468b Base64 encode the data result if the encoding param is set to "base64".
Fixes #1400.
2010-09-25 13:27:35 -07:00
Bharat Mediratta
6563ad1393 Return the right content type for album thumbnails (based on the album cover's mime type) 2010-08-14 22:00:53 -07:00
Bharat Mediratta
3c18762fda Change the way that this works. Now instead of sending back the image
metadata and the data itself JSON encoded, we just send back the raw
data with the right Content-Type.  This, combined with code in
Item_Model::as_restful_array() that swaps in /rest/data urls as
appropriate, means that the RESTful payload has consistent urls when
permissions are in play.
2010-08-09 22:54:57 -07:00
Bharat Mediratta
b7700d1eec Require the size parameter. Optional params are confusing. And be
robust in the face of a missing data file (movies and albums lack
resize, albums lack full size, some albums don't have a thumb if they
have no contents, etc)
2010-08-08 09:57:13 -07:00
Bharat Mediratta
4e95ec843a Allow item_rest::put() to replace the current data file. Remove
data_rest::put() altogether; it's no longer necessary.
2010-08-08 01:12:43 -07:00
Bharat Mediratta
20fd987296 A new REST resource that allows access to view and modify the actual
contents of the file, which enables REST viewers to see the actual
data which is useful when the files are privileged.  Currently it
returns the contents of the file in JSON encoded form, which may not
be the best.  Multipart/mime might be much better.

Fixes ticket #1224.
2010-08-07 22:33:01 -07:00