app/services/post_upserter.rb
# The following attributes will be copied from post JSON responses
# into local Post instances.
#
The following attributes will be copied from post JSON responses
into local Post instances.
The following attributes will be copied from post JSON responses into local Post instances .
def json_sane?
    if post_uri.host != source_uri.host
      raise InvalidData, "{post_uri.host} doesn't match expected host {source_uri.host} ({source_url})"
    end
     Actually, let's check the provided GUID anyway. For now, we're happy if it, too,
     uses the same host as the source URL.
    guid_host = json['guid'].split('/').first
    if guid_host != source_uri.host
      raise InvalidData, "{json['guid']} doesn't match expected host {source_uri.host} ({source_url})"
    end
    true
  end
def json_sane? if post_uri . host != source_uri . host raise InvalidData , "#{post_uri.host} doesn't match expected host #{source_uri.host} (#{source_url})" end guid_host = json [ 'guid' ] . split ( '/' ) . first if guid_host != source_uri . host raise InvalidData , "#{json['guid']} doesn't match expected host #{source_uri.host} (#{source_url})" end true end
The following attributes will be copied from post JSON responses
into local Post instances.
The following attributes will be copied from post JSON responses into local Post instances .
# We're okay with the JSON as long as the referenced post URL matches the # host we got the JSON from. # # Actually, let's check the provided GUID anyway. For now, we're happy if it, too, # uses the same host as the source URL.