Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Internal Server Error for non-ASCII Slugs #87

Open
miloush opened this issue Sep 26, 2018 · 4 comments
Open

500 Internal Server Error for non-ASCII Slugs #87

miloush opened this issue Sep 26, 2018 · 4 comments

Comments

@miloush
Copy link

miloush commented Sep 26, 2018

Include any non-ASII character in the Slug field such as ň, ش, 𐌸 or an emoji. Saving or creating a post results in 500 Internal Server Error. However, the post is saved and the Slug works as expected.

@braegelno5
Copy link
Contributor

Are you able to fix this?

@miloush
Copy link
Author

miloush commented Sep 28, 2018

The exception is thrown in BlogController.UpdatePost because it tries to redirect to the updated article which puts the new URL into the Location HTTP header and ASP.NET Core disapproves. The same happens in AddComment and DeleteComment. None of the easy solutions makes me happy so I guess I'd leave it to the authors.

Edit: To make it clear, my fix was to add

        public string GetEncodedLink()
        {
            return $"/blog/{WebUtility.UrlEncode(Slug)}/";
        }

to the Post and use that instead of GetLink in all Redirect calls.

@braegelno5
Copy link
Contributor

will you make a PR for this?
it's working on my blog, same error before..

@miloush
Copy link
Author

miloush commented Sep 30, 2018

Feel free to make one. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants