| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,12 +51,12 @@ public void AddStaticContent(string path, string prefix = "/", string filter = " | |||
| 51 | 51 | ||
| 52 | 52 | bool Handler(FileCache cache, string key, byte[] value, TimeSpan timespan) | |
| 53 | 53 | { | |
| 54 | - HttpResponse header = new HttpResponse(); | ||
| 55 | - header.SetBegin(200); | ||
| 56 | - header.SetContentType(Path.GetExtension(key)); | ||
| 57 | - header.SetHeader("Cache-Control", $"max-age={timespan.Seconds}"); | ||
| 58 | - header.SetBody(value); | ||
| 59 | - return cache.Add(key, header.Cache.Data, timespan); | ||
| 54 | + var response = new HttpResponse(); | ||
| 55 | + response.SetBegin(200); | ||
| 56 | + response.SetContentType(Path.GetExtension(key)); | ||
| 57 | + response.SetHeader("Cache-Control", $"max-age={timespan.Seconds}"); | ||
| 58 | + response.SetBody(value); | ||
| 59 | + return cache.Add(key, response.Cache.Data, timespan); | ||
| 60 | 60 | } | |
| 61 | 61 | ||
| 62 | 62 | Cache.InsertPath(path, prefix, filter, timeout.Value, Handler); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,12 +55,12 @@ public void AddStaticContent(string path, string prefix = "/", string filter = " | |||
| 55 | 55 | ||
| 56 | 56 | bool Handler(FileCache cache, string key, byte[] value, TimeSpan timespan) | |
| 57 | 57 | { | |
| 58 | - HttpResponse header = new HttpResponse(); | ||
| 59 | - header.SetBegin(200); | ||
| 60 | - header.SetContentType(Path.GetExtension(key)); | ||
| 61 | - header.SetHeader("Cache-Control", $"max-age={timespan.Seconds}"); | ||
| 62 | - header.SetBody(value); | ||
| 63 | - return cache.Add(key, header.Cache.Data, timespan); | ||
| 58 | + var response = new HttpResponse(); | ||
| 59 | + response.SetBegin(200); | ||
| 60 | + response.SetContentType(Path.GetExtension(key)); | ||
| 61 | + response.SetHeader("Cache-Control", $"max-age={timespan.Seconds}"); | ||
| 62 | + response.SetBody(value); | ||
| 63 | + return cache.Add(key, response.Cache.Data, timespan); | ||
| 64 | 64 | } | |
| 65 | 65 | ||
| 66 | 66 | Cache.InsertPath(path, prefix, filter, timeout.Value, Handler); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments