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
- PerformanceCounterManager.cs
- ProfessionalColorTable.cs
- filewebrequest.cs
- XmlEnumAttribute.cs
- StagingAreaInputItem.cs
- MessageSmuggler.cs
- FileReservationCollection.cs
- DesignerLoader.cs
- InkCanvasSelectionAdorner.cs
- PropertyConverter.cs
- BitmapMetadataEnumerator.cs
- SessionStateContainer.cs
- EditorZone.cs
- GlobalAllocSafeHandle.cs
- TypeValidationEventArgs.cs
- Underline.cs
- HtmlWindow.cs
- DbConnectionStringBuilder.cs
- WhitespaceSignificantCollectionAttribute.cs
- PartitionResolver.cs
- VirtualizedCellInfoCollection.cs
- StringSource.cs
- TypeElement.cs
- ListBase.cs
- FormParameter.cs
- GlobalizationSection.cs
- SqlDataSourceStatusEventArgs.cs
- entityreference_tresulttype.cs
- NavigationProperty.cs
- BaseCodePageEncoding.cs
- SplayTreeNode.cs
- XmlSerializerOperationGenerator.cs
- CodeSnippetStatement.cs
- HwndSourceParameters.cs
- StateValidator.cs
- RuleRef.cs
- XmlReflectionMember.cs
- SoapAttributeOverrides.cs
- followingsibling.cs
- RadioButton.cs
- ValueQuery.cs
- Rect3DConverter.cs
- Msmq.cs
- OdbcPermission.cs
- ProxySimple.cs
- XmlILCommand.cs
- ValueExpressions.cs
- TcpClientSocketManager.cs
- OneWayBindingElementImporter.cs
- ColumnWidthChangedEvent.cs
- DataGridViewControlCollection.cs
- FormatterConverter.cs
- ThreadPool.cs
- SiteMapDataSource.cs
- CollaborationHelperFunctions.cs
- Material.cs
- TextSelectionHighlightLayer.cs
- BuildProviderAppliesToAttribute.cs
- ListViewUpdateEventArgs.cs
- WindowsScrollBar.cs
- FrameworkRichTextComposition.cs
- FixedFlowMap.cs
- DistinctQueryOperator.cs
- DbDataRecord.cs
- Filter.cs
- DetailsViewUpdateEventArgs.cs
- EmptyStringExpandableObjectConverter.cs
- BamlLocalizableResource.cs
- Calendar.cs
- CodeDesigner.cs
- NativeMethods.cs
- SimpleHandlerFactory.cs
- EntityClassGenerator.cs
- DockProviderWrapper.cs
- OleDbSchemaGuid.cs
- SqlDataAdapter.cs
- DeviceContext.cs
- EntityDataSourceDesignerHelper.cs
- OneOfScalarConst.cs
- WebServiceData.cs
- ParserOptions.cs
- _BaseOverlappedAsyncResult.cs
- HiddenField.cs
- AssemblyUtil.cs
- IODescriptionAttribute.cs
- DesignerOptionService.cs
- KeyboardDevice.cs
- KnownTypesHelper.cs
- SqlStatistics.cs
- EmptyStringExpandableObjectConverter.cs
- WindowsGraphicsWrapper.cs
- ProxyWebPart.cs
- DataListItemEventArgs.cs
- Pointer.cs
- DataBinding.cs
- RowSpanVector.cs
- ExpressionHelper.cs
- CharacterBuffer.cs
- OleDbError.cs
- CursorConverter.cs