Merge pull request #2819 from BrzVlad/fix-major-log
[mono.git] / mcs / class / System.Web / System.Web.Handlers / AssemblyResourceLoader.cs
index f8264dffff2783b1fa7494249b3727fc1ecc9fd9..7f59b52e22b47f90653406803db3f8ef8acc6c08 100644 (file)
@@ -79,7 +79,9 @@ namespace System.Web.Handlers
                                        if (!hashAlg.CanReuseTransform) {
                                                canReuseHashAlg = false;
                                                hashAlg = null;
+                                               return null;
                                        }
+                                       hashAlg.Key = MachineKeySectionUtils.GetValidationKey (mks);
                                }
 
                                if (hashAlg != null)
@@ -272,9 +274,7 @@ namespace System.Web.Handlers
                                debug = resourceName.EndsWith (".debug.js", StringComparison.OrdinalIgnoreCase);
                                string dbgTail = debug ? "d" : String.Empty;
                                lookupKey = resourceNameHash + (notifyScriptLoaded ? "t" : "f") + dbgTail;
-#if NET_3_5
                                CheckIfResourceIsCompositeScript (resourceName, ref includeTimeStamp);
-#endif
 #else
                                lookupKey = resourceNameHash;
 #endif
@@ -314,16 +314,12 @@ namespace System.Web.Handlers
                        extra = QueryParamSeparator + "n=" + (notifyScriptLoaded ? "t" : "f");
 #endif
 
-#if TARGET_JVM
-                       atime = QueryParamSeparator + "t=" + assemblyName.GetHashCode ();
-#else
                        if (includeTimeStamp) {
                                if (!String.IsNullOrEmpty (assemblyPath) && File.Exists (assemblyPath))
                                        atime = QueryParamSeparator + "t=" + File.GetLastWriteTimeUtc (assemblyPath).Ticks;
                                else
                                        atime = QueryParamSeparator + "t=" + DateTime.UtcNow.Ticks;
                        }
-#endif
                        string d = HttpUtility.UrlEncode (assemblyNameHash + "_" + resourceNameHash +  (debug ? "_t" : "_f"));
                        string href = HandlerFileName + "?d=" + d + atime + extra;
                        HttpContext ctx = HttpContext.Current;
@@ -336,19 +332,6 @@ namespace System.Web.Handlers
                        return href;
                }
 
-               bool HasCacheControl (HttpRequest request, NameValueCollection queryString, out long atime)
-               {
-                       if (String.Compare (request.Headers ["Cache-Control"], "max-age=0", StringComparison.Ordinal) != 0) {
-                               atime = 0;
-                               return false;
-                       }
-                       
-                       if (Int64.TryParse (request.QueryString ["t"], out atime))
-                               return true;
-
-                       return false;
-               }
-
                bool HasIfModifiedSince (HttpRequest request, out DateTime modified)
                {
                        string modif_since = request.Headers ["If-Modified-Since"];
@@ -373,7 +356,6 @@ namespace System.Web.Handlers
                        response.Clear ();
                        response.StatusCode = 304;
                        response.ContentType = null;
-                       response.CacheControl = "public"; // easier to set it to public as MS than remove it
                        context.ApplicationInstance.CompleteRequest ();
                }
                
@@ -399,14 +381,6 @@ namespace System.Web.Handlers
                        else
                                assembly = Assembly.Load (entry.AssemblyName);
                        
-                       long atime;
-                       if (HasCacheControl (request, queryString, out atime)) {
-                               if (atime == File.GetLastWriteTimeUtc (assembly.Location).Ticks) {
-                                       RespondWithNotModified (context);
-                                       return;
-                               }
-                       }
-
                        DateTime modified;
                        if (HasIfModifiedSince (request, out modified)) {
                                if (File.GetLastWriteTimeUtc (assembly.Location) <= modified) {