use etag instead of last-modified.  Last-modified dates for AIR SDKs becaome 
unstable.  Sometimes it would give you different dates for the same file


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/301f030e
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/301f030e
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/301f030e

Branch: refs/heads/master
Commit: 301f030eaa2f5b789cd4574baf2d294f95a749fd
Parents: 4bca66d
Author: Alex Harui <aha...@apache.org>
Authored: Fri Nov 21 12:05:11 2014 -0800
Committer: Alex Harui <aha...@apache.org>
Committed: Fri Nov 21 12:05:17 2014 -0800

----------------------------------------------------------------------
 MD5Checker/src/MD5Checker.mxml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/301f030e/MD5Checker/src/MD5Checker.mxml
----------------------------------------------------------------------
diff --git a/MD5Checker/src/MD5Checker.mxml b/MD5Checker/src/MD5Checker.mxml
index 3e2b9c8..400e505 100644
--- a/MD5Checker/src/MD5Checker.mxml
+++ b/MD5Checker/src/MD5Checker.mxml
@@ -206,12 +206,16 @@ limitations under the License.
                     var headers:Array = event.responseHeaders;
                     for each (var header:URLRequestHeader in headers)
                     {
-                        if (header.name == "Last-Modified")
+                        if (header.name == "Etag" || header.name == "ETag")
                         {
                             lastModified = header.value;
+                            if (lastModified.indexOf('"') == 0)
+                                lastModified = lastModified.substr(1);
+                            if (lastModified.indexOf('"') == 
lastModified.length - 1)
+                                lastModified = lastModified.substr(0, 
lastModified.length - 1);
                             foundLastModified = true;
                         }
-                        else if ((header.name == "Etag" || header.name == 
"ETag") && lastModified == null)
+                        else if ((header.name == "Last-Modified") && 
lastModified == null)
                         {
                             lastModified = header.value;
                             foundLastModified = true;

Reply via email to