Closed neon-nyan closed 1 year ago
Much needed improvements! Really happy to see this PR. Does Hi3Mirror.Http use the user agent at all? If not, it would certainly be nice for it to do that.
Hi3Helper.Http doesn't use User-Agent by default. Yes, It would be nice to set the User-Agent. I will update the code one I get home.
Hi @BuIlDaLiBlE.
I've just updated this PR with some commits and it should be ready to get merged. As per note that the user-agent format might be changed since it replaces []
with ()
and HttpClient
will fail to parse the user-agent string because it can't accept square-braces.
The last commit also provides some fixes to another possibility of disposing issue due to race condition while another session is (in-fact) still getting initialized or even uncompleted. Here I'm also including the result of the "Aggressive Pause/Resume Click" test and now the Hi3Helper.Http handles it much better and faster than the last refactoring changes.
LGTM! Regarding the User Agent, I will change it so it conforms to the industry standard, was meaning to do it anyway.
Pull Request Overview
As a continuation of the previous PR #54 and due to many changes have been happening within the submodule, I'm deciding to re-create this "Submodule Update" PR to adjust the latest usage of submodule with this launcher. Some of the changes are including:
Hi3Helper.Http
instance got disposed properly.Related Issue:
Additional Note
An additional that need to be discussed later is an addition of the ability to use a custom User-Agent. This was previously broken since the Inner
HttpClient
was inconsistently initialized per session instead of using an existingHttpClient
from the parent class.Since the usage of the custom User-Agent seems to be used widely in this launcher, could we use the user-agent for the usage of this submodule as well?
Also, some examples as the result of this changes will be updated later in this PR.