mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 01:55:46 +08:00
FIX: never attempt to log invalid post numbers
Previously in some cases we would queue logging of invalid post numbers The impact would be we would miss logging an incoming link and would leak an error.
This commit is contained in:
@ -1095,6 +1095,18 @@ RSpec.describe TopicsController do
|
||||
end.to change(TopicViewItem, :count).by(1)
|
||||
end
|
||||
|
||||
it 'records a view to invalid post_number' do
|
||||
user = Fabricate(:user)
|
||||
|
||||
expect do
|
||||
get "/t/#{topic.slug}/#{topic.id}/#{256**4}", params: {
|
||||
u: user.username
|
||||
}
|
||||
expect(response.status).to eq(200)
|
||||
end.to change { IncomingLink.count }.by(1)
|
||||
|
||||
end
|
||||
|
||||
it 'records incoming links' do
|
||||
user = Fabricate(:user)
|
||||
|
||||
|
Reference in New Issue
Block a user