Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- Calendar.cs
- Brushes.cs
- TextTreeInsertElementUndoUnit.cs
- Material.cs
- GestureRecognizer.cs
- XsdCachingReader.cs
- Calendar.cs
- LongTypeConverter.cs
- SystemIcmpV6Statistics.cs
- CodeArrayIndexerExpression.cs
- WeakReferenceList.cs
- QualifiedCellIdBoolean.cs
- XmlReflectionMember.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- WorkerRequest.cs
- AuthenticationManager.cs
- CommandID.cs
- ColorTransform.cs
- WindowsAuthenticationEventArgs.cs
- ArrayElementGridEntry.cs
- ImplicitInputBrush.cs
- DataContractSerializer.cs
- WebPartConnection.cs
- MemberDescriptor.cs
- CategoryNameCollection.cs
- SharedConnectionListener.cs
- JavaScriptSerializer.cs
- AttributeAction.cs
- HtmlWindowCollection.cs
- ColumnResult.cs
- XmlSchemaAppInfo.cs
- WrappedIUnknown.cs
- ParseChildrenAsPropertiesAttribute.cs
- TextSearch.cs
- DesignerAttributeInfo.cs
- ParseNumbers.cs
- ColorConverter.cs
- ComplexLine.cs
- XsdDuration.cs
- XdrBuilder.cs
- KnownTypes.cs
- PrintDialogDesigner.cs
- CodeTypeConstructor.cs
- ChangeInterceptorAttribute.cs
- Visitor.cs
- Expressions.cs
- ChangeTracker.cs
- FontInfo.cs
- SignatureResourcePool.cs
- MethodToken.cs
- RadioButtonPopupAdapter.cs
- PersonalizationState.cs
- RelatedImageListAttribute.cs
- RequestCacheManager.cs
- LinqDataSourceValidationException.cs
- ObjectDataSourceView.cs
- CodeConditionStatement.cs
- BamlTreeMap.cs
- SQLBoolean.cs
- SendingRequestEventArgs.cs
- ZipIOExtraFieldPaddingElement.cs
- DataGridViewControlCollection.cs
- VersionUtil.cs
- GZipStream.cs
- LocalFileSettingsProvider.cs
- OperatingSystem.cs
- FixUp.cs
- WindowsScrollBarBits.cs
- OdbcFactory.cs
- StateBag.cs
- Application.cs
- ProjectionPruner.cs
- ResourceDictionary.cs
- SingleKeyFrameCollection.cs
- Form.cs
- LinqDataSource.cs
- ClrProviderManifest.cs
- CheckedPointers.cs
- HybridDictionary.cs
- _SslSessionsCache.cs
- TableCell.cs
- EventMappingSettings.cs
- AttributeQuery.cs
- EntityDataSourceContextDisposingEventArgs.cs
- Config.cs
- WebControlsSection.cs
- BuildProvidersCompiler.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- Int64KeyFrameCollection.cs
- RelationshipNavigation.cs
- IntSecurity.cs
- HtmlInputCheckBox.cs
- UnaryExpression.cs
- ViewUtilities.cs
- Logging.cs
- DummyDataSource.cs
- DbInsertCommandTree.cs
- ListViewTableCell.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- Activity.cs