-
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
enable to overwrite default headers by command line options #111
enable to overwrite default headers by command line options #111
Conversation
Hey, thanks for your interest in contribution! Happy to get in touch with the users of this project. I can understand the need for this change. However, the minor caveat is, that your current code is a breaking change, as your provided example command will have different behavior before and after the change. To make it non-breaking, we could introduce a new flag Another alternative would introducing a flag Your request would then look like this: protocurl -u https://example.com/foo \
-I ./proto -i ..ReqSomething -o ..ResSomething \
-d 'something:"1"' --curl --protoc -v \
--content-type "application/octet-stream" \
-H "Accept: application/octet-stream" What do you think? Before the merge, we also want to create/adapt the tests to the new functionality.
|
Thank you for your suggestion :) I'll come up with new implementation (including tests) soon |
I introduced |
Great! Thanks for updating the code. Your suggestion indeed makes more sense. You can find info on the tests here. You should also be able to run the tests on your own fork at Actions tab. I see, that the instruction to run the tests, namely first (once)
I'll go over the code and provide some feedback. Try to make the tests work locally. You should get the same errors as here. |
I've amended test and docs so now it passes CI. |
Thanks for adapting the tests. Unfortunately, it seems like I hdan't submitted the review comments, that I wrote yesterday. Please take a look at that. Other than that. I'm happy, that the testing documentation was good enough for you to use it. |
test/results/no-default-headers-with-custom-content-type-header-expected.txt
Show resolved
Hide resolved
Thanks for the quick improvements! Happy to integrate and review your PR :) One last thing. I think adding this feature to the small set of examples would be great. I think many people actually want to use it, so it makes sense, have this as an explicit example. You can take a look at this script and the examples template to add the new example. This explains how to run it. While there is only limited documentation there, I think the existing code should be enough for you to get the right pattern and add the new example. You could title it something like "Overriding the default Content-Type header and using custom headers" and give and example like After that, I don't see any remaining tasks for you and I'll take care of releasing a new minor version upgrade 👍 |
I've added an example use case of |
Thanks a lot! I'll merge it and release it. Thanks for contributing. 🥳 I hope you enjoyed it |
I am using |
Awesome! Really nice to hear that! 😊 |
I would like to use "Content-Type: application/octet-stream" (as it is in https://github.com/google/protorpc/blob/95849c9a3e414b9ba2d3da91fd850156348fe558/protorpc/protobuf.py#L50), but currently it is not possible because content-type header is defined in default headers ("Content-Type: application/x-protobuf") and not overwritten-able.
My use case is: