bruno
bruno copied to clipboard
When specifying "No Body" a Content-Type header is still sent
When doing a POST, PUT, or PATCH with the "No Body" option selected, a Content-Type
header is sent with the value of application/x-www-form-urlencoded
.
There should be no content type header sent
Can you check if this issue is happening in the latest version of Bruno, @jsonfry?
Got same issue using bruno v1.13.1
running on ubuntu (using apt repository release)
Yes, still a probelm on 1.14.0.
Here's a simple Python server that responds with the request headers as the body:
from http.server import BaseHTTPRequestHandler, HTTPServer
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
self._print_headers()
def do_POST(self):
self._print_headers()
def _print_headers(self):
self.send_response(200)
self.send_header('Content-type', 'text/plain')
self.end_headers()
for header, value in self.headers.items():
self.wfile.write(f"{header}: {value}\n".encode('utf-8'))
def run(server_class=HTTPServer, handler_class=RequestHandler, port=8000):
server_address = ('', port)
httpd = server_class(server_address, handler_class)
print(f"Server running on port {port}")
httpd.serve_forever()
if __name__ == "__main__":
run()
And here it is running, notice the returned header value for Content-Type, even though "no body" is selected: