mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 17:02:10 -10:00
code. Fix tabbing. * CachedVaryBy.cs: Give raw response keys a name, use the httpmethod in the key, and delimit items with \n so it is easier to read when debugging. svn path=/trunk/mcs/; revision=20506
54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
//
|
|
// System.Web.Caching.CachedVaryBy
|
|
//
|
|
// Author(s):
|
|
// Jackson Harper ([email protected])
|
|
//
|
|
// (C) 2003 Novell, Inc (http://www.novell.com)
|
|
//
|
|
|
|
|
|
using System;
|
|
using System.Text;
|
|
|
|
namespace System.Web.Caching {
|
|
|
|
internal class CachedVaryBy {
|
|
|
|
private string[] prms;
|
|
private string[] headers;
|
|
private string custom;
|
|
|
|
internal CachedVaryBy (HttpCachePolicy policy)
|
|
{
|
|
prms = policy.VaryByParams.GetParamNames ();
|
|
}
|
|
|
|
internal string CreateKey (string file_path, HttpRequest request)
|
|
{
|
|
StringBuilder builder = new StringBuilder ();
|
|
|
|
builder.Append ("CachedRawResponse\n");
|
|
builder.Append (file_path);
|
|
builder.Append ('\n');
|
|
builder.Append ("METHOD:" + request.HttpMethod);
|
|
builder.Append ('\n');
|
|
|
|
if (prms != null) {
|
|
for (int i=0; i<prms.Length; i++) {
|
|
if (request.Params [prms [i]] == null)
|
|
continue;
|
|
builder.Append ("VP:");
|
|
builder.Append (prms [i]);
|
|
builder.Append ('=');
|
|
builder.Append (request.Params [prms [i]]);
|
|
builder.Append ('\n');
|
|
}
|
|
}
|
|
|
|
return builder.ToString ();
|
|
}
|
|
}
|
|
}
|
|
|