Skip to content

Minor issues with RequestLocalizationMiddleware #59218

@S-Luiten

Description

@S-Luiten

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

There's an issue with the constructor documentation for RequestLocalizationMiddleware:
Image

Looking at the source code, it seems that line 31 and 32 need to be swapped around.
https://github.com/dotnet/aspnetcore/blob/main/src/Middleware/Localization/src/RequestLocalizationMiddleware.cs

I also noticed there's a null check on lines 138 if (cultureName != null) and 186 if (name == null || supportedCultures == null), however StringSegment is a struct, so it can never be null.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions