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
- UnionQueryOperator.cs
- ZipIOExtraField.cs
- AudienceUriMode.cs
- DesignSurface.cs
- XsdValidatingReader.cs
- ObjectHandle.cs
- ComplexLine.cs
- CodeLinePragma.cs
- PerformanceCounterPermission.cs
- NameTable.cs
- ToolStripRendererSwitcher.cs
- WindowCollection.cs
- ConnectionConsumerAttribute.cs
- ImageBrush.cs
- DropShadowBitmapEffect.cs
- FillRuleValidation.cs
- CryptoStream.cs
- ThreadAbortException.cs
- XmlDataSourceNodeDescriptor.cs
- Stackframe.cs
- StylusPlugInCollection.cs
- StatusInfoItem.cs
- Base64Encoding.cs
- DataGridRowEventArgs.cs
- XmlHierarchicalEnumerable.cs
- OutputScope.cs
- DetailsViewRowCollection.cs
- UnsafeCollabNativeMethods.cs
- UnsignedPublishLicense.cs
- Models.cs
- StyleCollection.cs
- DispatcherTimer.cs
- OdbcErrorCollection.cs
- HttpProfileBase.cs
- XmlKeywords.cs
- AssertFilter.cs
- OracleRowUpdatingEventArgs.cs
- DbProviderFactory.cs
- sqlnorm.cs
- Floater.cs
- SoapException.cs
- NotFiniteNumberException.cs
- RoleManagerSection.cs
- BinaryObjectInfo.cs
- ScriptManager.cs
- MasterPage.cs
- SectionInput.cs
- PagePropertiesChangingEventArgs.cs
- DtrList.cs
- SingleBodyParameterMessageFormatter.cs
- BmpBitmapEncoder.cs
- BindingsSection.cs
- FtpRequestCacheValidator.cs
- TdsParserSafeHandles.cs
- AliasGenerator.cs
- AspNetHostingPermission.cs
- MediaContext.cs
- StorageComplexTypeMapping.cs
- PaperSize.cs
- NameValueFileSectionHandler.cs
- CodeVariableReferenceExpression.cs
- TextBoxLine.cs
- StringSource.cs
- mediaeventargs.cs
- HttpAsyncResult.cs
- PersistenceProviderBehavior.cs
- AssemblyNameProxy.cs
- MethodCallTranslator.cs
- AsyncOperationManager.cs
- RequestQueue.cs
- DoubleLinkList.cs
- ToolStripStatusLabel.cs
- Cursor.cs
- DataGridViewColumnCollection.cs
- BuildProviderAppliesToAttribute.cs
- RowUpdatedEventArgs.cs
- PointCollectionValueSerializer.cs
- Touch.cs
- StateDesigner.CommentLayoutGlyph.cs
- NotifyIcon.cs
- BitmapEffectDrawingContextState.cs
- mediaeventshelper.cs
- DataPagerCommandEventArgs.cs
- WebServiceEnumData.cs
- ItemDragEvent.cs
- SimpleModelProvider.cs
- NotSupportedException.cs
- ClickablePoint.cs
- Stylus.cs
- DataGridHeaderBorder.cs
- PtsContext.cs
- SqlTriggerContext.cs
- VarInfo.cs
- ColorTransform.cs
- TransactionException.cs
- BinaryReader.cs
- VisualBrush.cs
- TextDpi.cs
- EncoderExceptionFallback.cs
- SettingsPropertyWrongTypeException.cs