update_bucket: detect and fix content-type mismatch

gsutil uses Python "mimetypes" to map file suffixes to Content-Type, and this
uses local configuration and/or registry settings on Windows. Check that the
mapping appears correct, and fix types if a mismatch is found.

Also adds a type check for the --force-destination-cr-position
to enforce that it's numeric only (no 'r' prefix).

Change-Id: Ib4f8a6824e2e339dd309670169143345557cc832
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1627215
Commit-Queue: Klaus Weidner <klausw@chromium.org>
Commit-Queue: Bill Orr <billorr@chromium.org>
Auto-Submit: Klaus Weidner <klausw@chromium.org>
Reviewed-by: Bill Orr <billorr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#662722}
1 file changed