Project

General

Profile

Actions

Bug #38482

closed

Accept "real" file uploads to /katello/api/repositories/:repository_id/content_uploads/:id

Added by Evgeni Golov 7 days ago. Updated 2 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Content Uploads
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

When uploading chunks using `PUT /katello/api/repositories/:repository_id/content_uploads/:id`, one can send the data as application/x-www-form-urlencoded and as multipart/form-data.
As urlencoded data is bigger, multipart is preferred.

Hammer seems to set "multipart: true" to RestClient in https://github.com/Katello/hammer-cli-katello/blob/1cb23adb604e2f8be56384a380666c22f5725bc6/lib/hammer_cli_katello/repository.rb#L535-L554
But while it's encoded as multipart, it's not flagged as a "file".

When using multipart uploads in Python (using requests), the controller receives a ActionDispatch::Http::UploadedFile (as requests always does "file" uploads), but never reads it, resulting in bad data being processed.

Actions

Also available in: Atom PDF