Skip to content

Header with Content-Lenght: 0 is sent even for GET requests with no body #150

@lucabelluccini

Description

@lucabelluccini

Logstash information:

  1. Logstash version (e.g. bin/logstash --version) 8.15 (any)
  2. Logstash installation source tar.gz
  3. How is Logstash being run run directly

JVM (e.g. java -version): bundled

OS version (uname -a if on a Unix-like system): MacOS

Description of the problem including expected versus actual behavior:

The server receiving the HTTP GET request will receive Content-Length: 0.
Some load balancers (e.g. AWS) can be strict and reject such requests.

Steps to reproduce:

Using the HTTP Poller input with:

input {
  http_poller {
    urls => {
      test => {
        method => GET
        url => "<URL>"
      }
    }
    codec => "json"
    schedule => { "every" => "1m" }
    metadata_target => "http_poller_metadata"
  }
}
output {
    stdout {
        codec => rubydebug
    }
}

The server will receive:

GET / HTTP/1.1
Host: ...
Accept-Encoding: gzip,deflate
Connection: Keep-Alive
Content-Length: 0
User-Agent: Manticore 0.9.1

This is likely in Manticore as this code still sends the Content-Length:

require 'manticore'
client = Manticore::Client.new
response = client.get('...') # or even , headers: { 'Content-Length' => nil })

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions