chore(GODT-2551): Store and Recover Last User Agent from Vault

This commit is contained in:
Leander Beernaert
2023-04-14 09:48:39 +02:00
parent 2191dc70dc
commit d6760d6f50
10 changed files with 103 additions and 12 deletions

View File

@ -550,7 +550,7 @@ func (bridge *Bridge) addUserWithVault(
// As such, if we find this ID in the context, we should use it to update our user agent.
client.AddPreRequestHook(func(_ *resty.Client, r *resty.Request) error {
if imapID, ok := imap.GetIMAPIDFromContext(r.Context()); ok {
bridge.identifier.SetClient(imapID.Name, imapID.Version)
bridge.setUserAgent(imapID.Name, imapID.Version)
}
return nil