lib/zold/http.rb
# HTTP header we add to each HTTP request, in order to inform
# the other node about the score. If the score is big enough,
# the remote node will add us to its list of remote nodes.
HTTP header we add to each HTTP request, in order to inform
the other node about the score. If the score is big enough,
the remote node will add us to its list of remote nodes.
HTTP header we add to each HTTP request in order to inform the other node about the score . If the score is big enough the remote node will add us to its list of remote nodes .
def headers
      headers = {
        'User-Agent': "Zold #{VERSION}",
        'Connection': 'close',
        'Accept-Encoding': 'gzip'
      }
      headers[Http::VERSION_HEADER] = VERSION
      headers[Http::NETWORK_HEADER] = @network
      headers[Http::SCORE_HEADER] = @score.reduced(4).to_text if @score.valid? && !@score.expired? && @score.value > 3
      headers
    end
def headers headers = { 'User-Agent' : "Zold #{VERSION}" , 'Connection' : 'close' , 'Accept-Encoding' : 'gzip' } headers [ Http :: VERSION_HEADER ] = VERSION headers [ Http :: NETWORK_HEADER ] = @network headers [ Http :: SCORE_HEADER ] = @score . reduced ( 4 ) . to_text if @score . valid? && ! @score . expired? && @score . value > 3 headers end
HTTP header we add to each HTTP request, in order to inform
the other node about the score.
HTTP header we add to each HTTP request in order to inform the other node about the score .