-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
B2-64 Throw error in CLI on passing special headers as file info #245
B2-64 Throw error in CLI on passing special headers as file info #245
Conversation
In cli v4 passing `--info b2-content-disposition=attachment` will result in an error telling the user to use `--content-disposition` etc.
Add --allow-special-info flag to disable validation of special headers passed to --info
b2/_internal/console_tool.py
Outdated
error_msg = "Use --{} flag instead of passing {} to --info".format( | ||
key.lstrip('b2-'), key | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any particular reason why you're preferring .format()
over f-string
in this instance?
This is not a request for change, just curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling functions/methods inside a f-string
feels weird to me. And the linter was complaining about %-formatting for some reason. I'll recheck anyways.
b2/_internal/b2v3/registry.py
Outdated
|
||
class CopyFileById(CopyFileByIdV4): | ||
__doc__ = CopyFileByIdV4.__doc__ | ||
WARN_SPECIAL_FILE_INFO_HEADERS = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer something like ERROR_ON_HEADERS_AS_FILE_INFO = False
(not necessarily this exact naming) because WARN_SPECIAL_FILE_INFO_HEADERS
might make it sound like in case of False
, there's just gonna be no warning, it's an allowed behavior. Whereas what happens is a stronger limitation - an error.
Just to double-check - while this looks good to me, this PR is not intended to be merged until changes in the SDK (or here?) adds |
Renamed `WARN_SPECIAL_FILE_INFO_HEADERS` -> `ERROR_ON_HEADERS_AS_FILE_INFO` and flipped the meaning
From `--allow-special-info` to `--allow-headers-in-info`
No description provided.