-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add a new http-user-agent config. #209
Conversation
Gives the ability to override the HTTP user agent.
LGTM. However, it was decided to deprecate
|
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.
Seems like the old user_agent
config already was used for HTTP, in the optional redirect filter:
request.add_header('User-agent', feed.user_agent) |
Can you change it to use the new http_user_agent
?
I found it while drafting a solution for adding a mail-user-agent
option, BTW. When I have time, and if the branch allows it, I will push my work onto here.
We're probably doing a release soon as the changes are slowly piling up, so I'd say something like:
Does that make sense? |
Or actually, given @amiryal's message about the fact that the previous user-agent was overloaded and the previous stage was basically a mess, we could skip the deprecation step and just write down the removal of the user-agent option in the changelog; though people's configuration files will break it may not be that bad because people won't read the warning messages anyway as it'll all be automated away. (BTW, all this is relying on the fact that I'm assuming anyone using rss2email would know how to edit the configuration file if pointed to it by a warning/error; I'm thinking this is a reasonable enough assumption) |
Noticed by @amiryal (thanks!)
Apologies for the lag, fixed that use case I missed, thanks @amiryal! |
That line of work ☝️ did not get anywhere useful. Since it was already overloaded for use in HTTP, and since I can’t think of a use case for 2 different values for HTTP and message-header agent strings*, I think we can kidnap * Frankly, I can’t think of a use case for changing the message header at all. It seems like this one is purely informational for the end recipient, so it’s only useful to change it if one likes to hide the use of r2e for whatever reason. If that is the case, then we can direct users to write a custom post_process hook. |
@rand0mdud3 if you agree with the above, then I think it would be OK to implement it in this PR. Just remember to reflect the additional use of the config option in the manual. |
@amiryal For backwards-compatibility reasons, I don't think changing the meaning of user-agent from "something somewhat useless but that doesn't impact usage" to "something that will change all outgoing http requests" would be a good idea. So, just for this reason, I don't think reusing user-agent for http headers right now would be a good idea. That said, just removing user-agent altogether and adding http-user-agent for the http header would probably make sense to me :) |
I agree with not using user-agent for HTTP and instead adding a new http-user-agent, but I don't fully agree with removing user-agent as it isn't much code and no one likes having features they use removed from a program. Do post-process hooks need to be added to rss2email or will it load them from a user owned directory? Can multiple post-process hooks be used? If both are possible, then maybe a post-process hook could replace user-agent. Fun fact, f57513a#diff-86d7b95911fb37a51f57d39f3ab50678bdf8f85d9d6a1853bf05eb75729e8461L64 in #74 hijacked the static http user agent to add a customizable mail user agent. |
Somehow I missed that! So, effectively, f57513a introduced an unintended change of behaviour in 3.11, which we are now trying to untangle. Anecdotally, that same commit also broke the I would put it this way:
Ignoring the discussion thus far, I hope we can agree on at least the first two bullets. The third bullet raises a couple of contention points:
TL;DRIf updating the manual accordingly and adding the support of some good release notes to explain the situation, I am still in favour of:
|
The latter — they simply need to be somewhere in
Only one can be named in the configuration, but there is nothing to stop users from calling multiple others in a chain from their custom post-process hook. |
Gives the ability to override the HTTP user agent.
This should take care of #154
Also related to #120 (which applies to the mail user agent).