mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 06:48:18 +08:00
FIX: permalinks redirect on subfolder installs could add the subfolder to the url twice
This commit is contained in:
@ -10,6 +10,16 @@ describe PermalinksController do
|
||||
expect(response.status).to eq(301)
|
||||
end
|
||||
|
||||
it "should work for subfolder installs too" do
|
||||
GlobalSetting.stubs(:relative_url_root).returns('/forum')
|
||||
Discourse.stubs(:base_uri).returns("/forum")
|
||||
permalink = Fabricate(:permalink)
|
||||
Permalink.any_instance.stubs(:target_url).returns('/forum/t/the-topic-slug/42')
|
||||
get :show, url: permalink.url
|
||||
expect(response).to redirect_to('/forum/t/the-topic-slug/42')
|
||||
expect(response.status).to eq(301)
|
||||
end
|
||||
|
||||
it "should apply normalizations" do
|
||||
SiteSetting.permalink_normalizations = "/(.*)\\?.*/\\1"
|
||||
|
||||
|
Reference in New Issue
Block a user