public static IsValid ( string compressionType ) : bool | ||
compressionType | string | |
return | bool |
public static bool IsValid(string compressionType)
{
return compressionType == Deflate || compressionType == GZip;
}
public CompressedFileResult(string filePath, string compressionType, string contentMimeType) { if (!CompressionTypes.IsValid(compressionType)) { throw new ArgumentException(@"Must be either 'deflate' or 'gzip'", compressionType); } this.FilePath = filePath; this.Headers = new Dictionary <string, string> { { HttpHeaders.ContentType, contentMimeType }, { HttpHeaders.ContentEncoding, compressionType }, }; }