Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / xsp / System / Web / Extensions / Util / HeaderUtility.cs / 1 / HeaderUtility.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Util { using System; internal static class HeaderUtility { public static bool IsEncodingInAcceptList(string acceptEncodingHeader, string expectedEncoding) { if (String.IsNullOrEmpty(acceptEncodingHeader)) { return false; } foreach (string encoding in acceptEncodingHeader.Split(',')) { string e = encoding.Trim(); // This code will typically handle all existing browsers, which // use "encoding1, encoding2" for this header. // IE, Firefox and Safari are sending "gzip, deflate" // Opera is sending "deflate, gzip, x-gzip, identity, *;q=0" // There is a currently hypothetical case where a browser would use the quantified syntax // on specific encodings ("encoding1;q=0.8, encoding2 ;q=0.2") which we don't handle here. // For those situations, the browser would get the uncompressed version. // See RFC 2068 for details. if (String.Equals(e, expectedEncoding, StringComparison.Ordinal)) { return true; } } // no match found return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Util { using System; internal static class HeaderUtility { public static bool IsEncodingInAcceptList(string acceptEncodingHeader, string expectedEncoding) { if (String.IsNullOrEmpty(acceptEncodingHeader)) { return false; } foreach (string encoding in acceptEncodingHeader.Split(',')) { string e = encoding.Trim(); // This code will typically handle all existing browsers, which // use "encoding1, encoding2" for this header. // IE, Firefox and Safari are sending "gzip, deflate" // Opera is sending "deflate, gzip, x-gzip, identity, *;q=0" // There is a currently hypothetical case where a browser would use the quantified syntax // on specific encodings ("encoding1;q=0.8, encoding2 ;q=0.2") which we don't handle here. // For those situations, the browser would get the uncompressed version. // See RFC 2068 for details. if (String.Equals(e, expectedEncoding, StringComparison.Ordinal)) { return true; } } // no match found return false; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Vector3dCollection.cs
- PeerIPHelper.cs
- SizeFConverter.cs
- CodeTypeReferenceSerializer.cs
- ResourcesBuildProvider.cs
- NumericUpDown.cs
- WorkflowApplication.cs
- securitycriticaldataformultiplegetandset.cs
- UriWriter.cs
- StrongName.cs
- NullableLongMinMaxAggregationOperator.cs
- PolygonHotSpot.cs
- SecurityContextTokenValidationException.cs
- ConsoleCancelEventArgs.cs
- PartialCachingAttribute.cs
- HwndSourceParameters.cs
- EntityTypeBase.cs
- ClusterRegistryConfigurationProvider.cs
- SqlClientPermission.cs
- CheckBoxField.cs
- StrongNameMembershipCondition.cs
- UICuesEvent.cs
- RadioButtonList.cs
- SnapLine.cs
- CodeMemberProperty.cs
- WebEvents.cs
- SchemaLookupTable.cs
- TextDecoration.cs
- TransformGroup.cs
- ListenerElementsCollection.cs
- LeaseManager.cs
- FrameSecurityDescriptor.cs
- CompressedStack.cs
- TypeUsageBuilder.cs
- MultiViewDesigner.cs
- Partitioner.cs
- SetStateDesigner.cs
- WindowsListViewItemCheckBox.cs
- DependencyObject.cs
- Misc.cs
- HttpValueCollection.cs
- Freezable.cs
- TypeExtensionSerializer.cs
- MetabaseServerConfig.cs
- Transform3DCollection.cs
- DropSource.cs
- TakeQueryOptionExpression.cs
- ErrorFormatter.cs
- DragCompletedEventArgs.cs
- TemplateParser.cs
- AsyncOperation.cs
- HtmlTable.cs
- WebHeaderCollection.cs
- SectionVisual.cs
- XmlDataLoader.cs
- SR.cs
- Comparer.cs
- TextRangeProviderWrapper.cs
- DataGridViewCellParsingEventArgs.cs
- ProfileParameter.cs
- XmlSiteMapProvider.cs
- SslSecurityTokenParameters.cs
- ReferencedType.cs
- DateTimeFormatInfo.cs
- DataListItemEventArgs.cs
- DocumentOrderComparer.cs
- SQLString.cs
- Opcode.cs
- PersonalizationEntry.cs
- COMException.cs
- DescendentsWalkerBase.cs
- TraceSection.cs
- ConfigurationErrorsException.cs
- SqlStream.cs
- SqlOuterApplyReducer.cs
- DictationGrammar.cs
- MemberAssignment.cs
- ShapeTypeface.cs
- ForeignConstraint.cs
- StylusButtonCollection.cs
- ConfigurationStrings.cs
- CharacterBufferReference.cs
- MetadataPropertyCollection.cs
- PartialTrustHelpers.cs
- SystemFonts.cs
- GraphicsState.cs
- DataGridViewLinkColumn.cs
- HttpBrowserCapabilitiesWrapper.cs
- XmlSchemaAny.cs
- SelectionEditor.cs
- ParserHooks.cs
- SettingsBindableAttribute.cs
- SpecialNameAttribute.cs
- ShapingWorkspace.cs
- SlipBehavior.cs
- BaseContextMenu.cs
- PropertyItemInternal.cs
- HybridCollection.cs
- AttributeCollection.cs
- SettingsContext.cs