Ignore:
Timestamp:
Aug 1, 2022, 12:26:44 PM (2 years ago)
Author:
alloc
Message:

Made SpaceWizards.HttpListener compilable against .NET 4.8 with preprocessor define UNITY_NETFRAMEWORK

File:
1 edited

Legend:

Unmodified
Added
Removed
  • binary-improvements2/SpaceWizards.HttpListener/src/System/Net/HttpListenerRequest.cs

    r376 r377  
    11// Licensed to the .NET Foundation under one or more agreements.
    22// The .NET Foundation licenses this file to you under the MIT license.
     3
     4// ReSharper disable RedundantUsingDirective
     5// ReSharper disable RedundantUnsafeContext
     6// ReSharper disable RedundantToStringCall
     7// ReSharper disable ConditionIsAlwaysTrueOrFalse
    38
    49using System;
     
    185190                        _keepAlive =
    186191                            header.IndexOf("close", StringComparison.OrdinalIgnoreCase) < 0 ||
     192#if UNITY_NETFRAMEWORK
     193                            header.IndexOf("keep-alive", StringComparison.OrdinalIgnoreCase) >= 0;
     194#else
    187195                            header.Contains("keep-alive", StringComparison.OrdinalIgnoreCase);
     196#endif
    188197                    }
    189198                }
     
    343352                        return null;
    344353
     354#if UNITY_NETFRAMEWORK
     355                    attrValue = headerValue.Substring(i + 1, j - i - 1).Trim();
     356#else
    345357                    attrValue = headerValue.AsSpan(i + 1, j - i - 1).Trim().ToString();
     358#endif
    346359                }
    347360                else
     
    356369                        return null;
    357370
     371#if UNITY_NETFRAMEWORK
     372                    attrValue = headerValue.Substring(i, j - i).Trim();
     373#else
    358374                    attrValue = headerValue.AsSpan(i, j - i).Trim().ToString();
     375#endif
    359376                }
    360377
Note: See TracChangeset for help on using the changeset viewer.