mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: crawler view with unicode usernames (#27051)
When "unicode_usernames" is enabled, calling the "user_path" helper with a username containing some non ASCII character will break due to the route constraint we have on username. This fixes the issue by always encoding the username before passing it to the "user_path" helper. Internal ref - t/127547
This commit is contained in:
@ -38,6 +38,14 @@ RSpec.describe AboutController do
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.body).to include("/u/anadminuser")
|
||||
end
|
||||
|
||||
it "supports unicode usernames" do
|
||||
SiteSetting.unicode_usernames = true
|
||||
Fabricate(:admin, username: "martínez")
|
||||
get "/about", headers: { "HTTP_USER_AGENT" => "Googlebot" }
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.body).to include("/u/mart%25C3%25ADnez")
|
||||
end
|
||||
end
|
||||
|
||||
it "serializes stats when 'Guardian#can_see_about_stats?' is true" do
|
||||
|
Reference in New Issue
Block a user