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
- TypeDelegator.cs
- NativeMethodsOther.cs
- PersistChildrenAttribute.cs
- Container.cs
- PageTextBox.cs
- XmlSchemaValidationException.cs
- TraceSection.cs
- Geometry.cs
- RangeValuePattern.cs
- SystemBrushes.cs
- SqlDataSourceCache.cs
- ColumnMapVisitor.cs
- XhtmlBasicPanelAdapter.cs
- EnlistmentTraceIdentifier.cs
- ItemsPanelTemplate.cs
- BufferBuilder.cs
- ListViewCancelEventArgs.cs
- StyleBamlRecordReader.cs
- TextServicesLoader.cs
- SetState.cs
- HMACSHA512.cs
- ListBase.cs
- RowVisual.cs
- DragDeltaEventArgs.cs
- HierarchicalDataSourceControl.cs
- BigIntegerStorage.cs
- ConnectionConsumerAttribute.cs
- Rectangle.cs
- ToolboxBitmapAttribute.cs
- Line.cs
- EastAsianLunisolarCalendar.cs
- infer.cs
- ShortcutKeysEditor.cs
- Misc.cs
- SessionStateUtil.cs
- BaseTemplateBuildProvider.cs
- Pair.cs
- DoubleCollection.cs
- Decorator.cs
- BindableTemplateBuilder.cs
- SmtpTransport.cs
- BaseParser.cs
- SqlTriggerAttribute.cs
- Rss20ItemFormatter.cs
- HttpConfigurationSystem.cs
- FlagsAttribute.cs
- Number.cs
- WebPartTransformer.cs
- AmbientLight.cs
- TypeDescriptor.cs
- WebMethodAttribute.cs
- DatePickerAutomationPeer.cs
- FunctionQuery.cs
- WebPartManagerInternals.cs
- DynamicObjectAccessor.cs
- FixUp.cs
- MemberInitExpression.cs
- CodeThrowExceptionStatement.cs
- UnsafeNetInfoNativeMethods.cs
- CompositionCommandSet.cs
- XslCompiledTransform.cs
- ModifierKeysValueSerializer.cs
- URLBuilder.cs
- TableLayoutSettingsTypeConverter.cs
- OrderingInfo.cs
- WhitespaceSignificantCollectionAttribute.cs
- RequiredAttributeAttribute.cs
- CodeExporter.cs
- DataSourceView.cs
- DefaultValueConverter.cs
- SqlInternalConnectionSmi.cs
- SpecularMaterial.cs
- QueryStoreStatusRequest.cs
- SqlDataRecord.cs
- ControlIdConverter.cs
- EntityException.cs
- UserNamePasswordServiceCredential.cs
- ClipboardProcessor.cs
- GregorianCalendarHelper.cs
- DispatcherObject.cs
- RightsManagementEncryptionTransform.cs
- SelectedDatesCollection.cs
- CollectionsUtil.cs
- MenuItemBindingCollection.cs
- LostFocusEventManager.cs
- ColorConvertedBitmap.cs
- CommonDialog.cs
- PrivilegedConfigurationManager.cs
- RtfToken.cs
- OdbcParameter.cs
- PointHitTestResult.cs
- AnyAllSearchOperator.cs
- DictionaryBase.cs
- RelatedImageListAttribute.cs
- SubstitutionDesigner.cs
- ActivationWorker.cs
- XmlStrings.cs
- CompressStream.cs
- SimpleTextLine.cs
- webproxy.cs