diff --git a/osc/core.py b/osc/core.py index 1d2543789..0499cfe72 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2933,8 +2933,8 @@ def create_memoryview(obj): req.get_method = lambda: method # POST requests are application/x-www-form-urlencoded per default - # since we change the request into PUT, we also need to adjust the content type header - if method == 'PUT' or (method == 'POST' and data): + # but sending data requires an octet-stream type + if method == 'PUT' or (method == 'POST' and (data or file)): req.add_header('Content-Type', 'application/octet-stream') if isinstance(headers, type({})):