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
- InvalidPrinterException.cs
- CompositeFontParser.cs
- PerfCounters.cs
- ToolStripMenuItem.cs
- _ConnectStream.cs
- PartialArray.cs
- WindowsProgressbar.cs
- RelationshipConstraintValidator.cs
- RootBuilder.cs
- XmlSchemaException.cs
- SortDescriptionCollection.cs
- ToolStripItemTextRenderEventArgs.cs
- RoutedCommand.cs
- ListDataBindEventArgs.cs
- ReadOnlyDictionary.cs
- GiveFeedbackEvent.cs
- MarshalDirectiveException.cs
- XmlConverter.cs
- StorageAssociationSetMapping.cs
- X509AsymmetricSecurityKey.cs
- ConfigXmlComment.cs
- DefaultIfEmptyQueryOperator.cs
- CodeDomDecompiler.cs
- XmlSchemaComplexContent.cs
- ComPlusInstanceProvider.cs
- RelationshipConverter.cs
- MessageSmuggler.cs
- CrossAppDomainChannel.cs
- HttpResponse.cs
- ImageInfo.cs
- WinCategoryAttribute.cs
- LogLogRecordHeader.cs
- WebPartChrome.cs
- MethodRental.cs
- Screen.cs
- NavigationProgressEventArgs.cs
- HttpStreamXmlDictionaryReader.cs
- MultiAsyncResult.cs
- SessionStateItemCollection.cs
- Predicate.cs
- SqlInternalConnectionSmi.cs
- NegationPusher.cs
- StorageComplexPropertyMapping.cs
- ToolStripSeparator.cs
- DoubleLinkListEnumerator.cs
- TimerEventSubscriptionCollection.cs
- PolicyManager.cs
- PermissionSet.cs
- ToolStripSplitStackLayout.cs
- CodeMemberMethod.cs
- FormViewDeletedEventArgs.cs
- DetailsViewDeleteEventArgs.cs
- RegexCapture.cs
- UntrustedRecipientException.cs
- RealProxy.cs
- QilUnary.cs
- X509Utils.cs
- PasswordBoxAutomationPeer.cs
- DbConnectionPoolCounters.cs
- EncryptedHeaderXml.cs
- XsltFunctions.cs
- ExceptionNotification.cs
- ColorTransform.cs
- Guid.cs
- BitmapCacheBrush.cs
- GeometryModel3D.cs
- Axis.cs
- _Semaphore.cs
- FileDialog_Vista_Interop.cs
- WorkerRequest.cs
- DisplayInformation.cs
- XmlLanguageConverter.cs
- TextEditorCharacters.cs
- TreeViewAutomationPeer.cs
- Wrapper.cs
- SchemeSettingElementCollection.cs
- CodeCatchClause.cs
- ThumbAutomationPeer.cs
- EventWaitHandle.cs
- SkinIDTypeConverter.cs
- CompositeScriptReference.cs
- ImageBrush.cs
- CompiledQueryCacheEntry.cs
- WebPartZoneBase.cs
- PlacementWorkspace.cs
- MouseGestureConverter.cs
- PassportAuthenticationEventArgs.cs
- HtmlContainerControl.cs
- PathSegmentCollection.cs
- DataSourceControl.cs
- MouseBinding.cs
- CatalogZone.cs
- ClientUIRequest.cs
- UnsafeNativeMethods.cs
- FixedSOMSemanticBox.cs
- BigInt.cs
- LayoutEngine.cs
- ToolboxComponentsCreatingEventArgs.cs
- XmlAggregates.cs
- Sentence.cs