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
- StringAnimationBase.cs
- StringKeyFrameCollection.cs
- DigestComparer.cs
- TextTreeInsertUndoUnit.cs
- SoapReflectionImporter.cs
- SerializableAuthorizationContext.cs
- SparseMemoryStream.cs
- ListParaClient.cs
- XmlLanguageConverter.cs
- TransformationRules.cs
- AudioLevelUpdatedEventArgs.cs
- WindowsTreeView.cs
- Constraint.cs
- BehaviorEditorPart.cs
- DictionaryCustomTypeDescriptor.cs
- FontFamily.cs
- EventLogPermission.cs
- GeometryModel3D.cs
- CollectionBuilder.cs
- _NegotiateClient.cs
- HtmlElement.cs
- AuthenticationModulesSection.cs
- XmlDesigner.cs
- XamlNamespaceHelper.cs
- TdsParserSessionPool.cs
- SpeechRecognitionEngine.cs
- LinkedList.cs
- WebDescriptionAttribute.cs
- DataGridColumnCollectionEditor.cs
- EdmProperty.cs
- CornerRadiusConverter.cs
- SafeSystemMetrics.cs
- HttpCookieCollection.cs
- cookieexception.cs
- Assert.cs
- TypeElement.cs
- _TransmitFileOverlappedAsyncResult.cs
- CodeNamespaceCollection.cs
- RtfFormatStack.cs
- IncrementalReadDecoders.cs
- SmiMetaData.cs
- complextypematerializer.cs
- WizardStepCollectionEditor.cs
- BamlTreeNode.cs
- LabelDesigner.cs
- ManagedFilter.cs
- SiteMapProvider.cs
- WorkflowDurableInstance.cs
- CalloutQueueItem.cs
- NativeMethodsOther.cs
- HashMembershipCondition.cs
- PersistencePipeline.cs
- BitmapSourceSafeMILHandle.cs
- EnumValAlphaComparer.cs
- DataService.cs
- SelectionItemPattern.cs
- UserControlAutomationPeer.cs
- PeerHelpers.cs
- OdbcTransaction.cs
- embossbitmapeffect.cs
- Expr.cs
- ThreadPool.cs
- ConfigurationLockCollection.cs
- ToolStripOverflow.cs
- ClosableStream.cs
- TableLayoutPanel.cs
- CategoryNameCollection.cs
- SponsorHelper.cs
- AddInActivator.cs
- StrongNameKeyPair.cs
- DataGridColumnHeadersPresenter.cs
- DetailsViewActionList.cs
- VirtualDirectoryMapping.cs
- EntityDataSourceWizardForm.cs
- DefaultDiscoveryServiceExtension.cs
- Marshal.cs
- AccessibilityHelperForXpWin2k3.cs
- TrackingLocation.cs
- HtmlInputButton.cs
- SystemInformation.cs
- AttributeEmitter.cs
- SelectiveScrollingGrid.cs
- DependencyObjectType.cs
- TypeBrowserDialog.cs
- PartitionResolver.cs
- RepeaterCommandEventArgs.cs
- AppLevelCompilationSectionCache.cs
- DependencyPropertyAttribute.cs
- ClientConfigurationSystem.cs
- GetTokenRequest.cs
- ClientBuildManager.cs
- ToolboxItemAttribute.cs
- AttachmentCollection.cs
- RSAOAEPKeyExchangeFormatter.cs
- HuffCodec.cs
- DataServiceRequestOfT.cs
- Rectangle.cs
- RoutedCommand.cs
- X509CertificateChain.cs
- DnsPermission.cs