The diaspora ID validator now validates if it is lowercase

Relaying relayables will fail with non-lowercase authors.

closes #7625
This commit is contained in:
Benjamin Neff 2017-09-23 05:11:28 +02:00
parent 84b89d5594
commit 3fafcd9307
No known key found for this signature in database
GPG key ID: 971464C3F1A90194
3 changed files with 4 additions and 12 deletions

View file

@ -30,6 +30,9 @@
* Show users vote in polls [#7550](https://github.com/diaspora/diaspora/pull/7550)
* Add explanation of ignore function to in-app help section [#7585](https://github.com/diaspora/diaspora/pull/7585)
* Add camo information to NodeInfo [#7617](https://github.com/diaspora/diaspora/pull/7617)
* Add support for `diaspora://` links [#7625](https://github.com/diaspora/diaspora/pull/7625)
* Add support to relay likes for comments [#7625](https://github.com/diaspora/diaspora/pull/7625)
* Implement RFC 7033 WebFinger [#7625](https://github.com/diaspora/diaspora/pull/7625)
# 0.7.0.1

View file

@ -189,7 +189,7 @@ class PeopleController < ApplicationController
end
def diaspora_id?(query)
!(query.nil? || query.lstrip.empty?) && Validation::Rule::DiasporaId.new.valid_value?(query)
!(query.nil? || query.lstrip.empty?) && Validation::Rule::DiasporaId.new.valid_value?(query.downcase).present?
end
# view this profile on the home pod, if you don't want to sign in...

View file

@ -625,17 +625,6 @@ describe Diaspora::Federation::Receive do
Diaspora::Federation::Receive.perform(status_message_entity)
end
it "finds the correct author if the author is not lowercase" do
status_message_entity = Fabricate(:status_message_entity, author: sender.diaspora_handle.upcase)
received = Diaspora::Federation::Receive.perform(status_message_entity)
status_message = StatusMessage.find_by!(guid: status_message_entity.guid)
expect(received).to eq(status_message)
expect(status_message.author).to eq(sender)
end
end
context "with poll" do