This PR pushes forward towards version 4.0, although a lot remains to be done.
All tests pass. Yay for me! 😄
Some significant changes have been incorporated in fix-warnings-by-the dozen mega-commits. My bad. I'll point to the relevant commits in the list that follows.
Changes include:
Improvements to the build system (6289ec9, 468d053, e15ea45)
Some hundred warnings fixed: from possible null dereferentiations to lack of parameter checking, from code style to XML documentation grammar... and it's not over yet! (30f7b8e, a1a089e)
[ADD] New constructors for TestHttpClient (30f7b8e, a1a089e)
[BRK] Property ITestWebServer.BaseUrl is now of type System.Uri instead of string (30f7b8e)
[BRK] The MockFileProvider.GetRandomDataLength() method has become the RandomDataLength property (30f7b8e)
[ADD] TestWebServer can also be constructed from an Uri (previously it had to be a string) (30f7b8e)
[ADD] Static property TestWebServer.DefaultBaseUri to complement the already-existing DefaultBaseUrl (30f7b8e)
[BRK] Property RedirectModule.RedirectUrl is now called Location - the first in a series of name changes dictated by ~best practices~ StyleCop (30f7b8e)
[ADD] All classes implementing IMimeTypeProvider now expose all methods of said interface as public. This means that two more public methods (GetMimeType and TryDetermineCompression) are available on FileModule, ModuleGroup, and WebServerBase<TOptions>. Hiding those methods could trigger some... interesting edge cases, as outlined in the documentation for the averted warning (30f7b8e)
[BRK] Interface IWebModuleImpl (interesting to no one except module developers) no longer has a settable Container property; it has a SetContainer method instead, so the Container property of implementing classes can stay read-only (30f7b8e)
[ADD] ValidatedNotNullAttribute can be applied to method parameters to signal static analysis that, once the method returns, the parameter is known to be non-null. More info here (30f7b8e)
[BRK] The two WebSocketModule.SendAsync overloads, used to send string and binary payloads respectively, are now static methods (30f7b8e)
[FIX] CorsModule, after converting allowed origins to all-uppercase (was all-lowercase in version 3), did case-insensitive comparisons with requests' Origin headers, resulting in CORS preflight false negatives. This bug is still present in version 3 (c37cf2e)
[BRK][ADD] The newly-introduced ConfigurationLockSource has been renamed to ConfigurationLockTokenSource, while the renaming of ConfigurationLockToken to a simpler LockToken, and a LockTokenSource class, allow for use outside the scope of configurations ((784ec0e)
[ADD] Static boolean properties WebServer.IsIPv4Supported and WebServer.IsIPv6Supported tell whether each of the two IP stacks is supported by the machine running EmbedIO (e1d86e3)
This pull request fixes 3 alerts when merging 77d8dce1072708ff604562ed3289f75aac8660cd into 65d34efd8a71c2f35f7323e507c1e9a8f6816814 - view on LGTM.com
This PR pushes forward towards version 4.0, although a lot remains to be done.
All tests pass. Yay for me! 😄
Some significant changes have been incorporated in fix-warnings-by-the dozen mega-commits. My bad. I'll point to the relevant commits in the list that follows.
Changes include:
TestHttpClient
(30f7b8e, a1a089e)ITestWebServer.BaseUrl
is now of typeSystem.Uri
instead ofstring
(30f7b8e)MockFileProvider.GetRandomDataLength()
method has become theRandomDataLength
property (30f7b8e)MockFileProvider
now uses aRNGCryptoServiceProvider
to generate random data (30f7b8e)TestWebServer
can also be constructed from anUri
(previously it had to be astring
) (30f7b8e)TestWebServer.DefaultBaseUri
to complement the already-existingDefaultBaseUrl
(30f7b8e)RedirectModule.RedirectUrl
is now calledLocation
- the first in a series of name changes dictated by ~best practices~ StyleCop (30f7b8e)IMimeTypeProvider
now expose all methods of said interface as public. This means that two more public methods (GetMimeType
andTryDetermineCompression
) are available onFileModule
,ModuleGroup
, andWebServerBase<TOptions>
. Hiding those methods could trigger some... interesting edge cases, as outlined in the documentation for the averted warning (30f7b8e)IWebModuleImpl
(interesting to no one except module developers) no longer has a settableContainer
property; it has aSetContainer
method instead, so theContainer
property of implementing classes can stay read-only (30f7b8e)ValidatedNotNullAttribute
can be applied to method parameters to signal static analysis that, once the method returns, the parameter is known to be non-null. More info here (30f7b8e)WebSocketModule.SendAsync
overloads, used to send string and binary payloads respectively, are now static methods (30f7b8e)CorsModule
, after converting allowed origins to all-uppercase (was all-lowercase in version 3), did case-insensitive comparisons with requests'Origin
headers, resulting in CORS preflight false negatives. This bug is still present in version 3 (c37cf2e)ConfigurationLockSource
has been renamed toConfigurationLockTokenSource
, while the renaming ofConfigurationLockToken
to a simplerLockToken
, and aLockTokenSource
class, allow for use outside the scope of configurations ((784ec0e)WebServer.IsIPv4Supported
andWebServer.IsIPv6Supported
tell whether each of the two IP stacks is supported by the machine running EmbedIO (e1d86e3)