goaaats / xivlauncher-neo

XIVLauncher: The Next Degeneration
GNU General Public License v3.0
15 stars 7 forks source link

Preserve order of HTTP headers when building requests #11

Open goaaats opened 2 years ago

goaaats commented 2 years ago

This is needed to make 100% accurate requests. For forms, I solved this by using a LinkedHashMap implementation.

goaaats commented 2 years ago

This is impossible without forking http and reqwest - if we want to fix this, it'd probably be smarter to just use curl bindings or something like that.

karashiiro commented 2 years ago

https://hyper.rs/guides/client/advanced/ Haven't tried it, but this might work.

karashiiro commented 2 years ago

reqwest uses it internally.

goaaats commented 2 years ago

It also uses HTTP's HeaderMap(https://github.com/hyperium/http/blob/master/src/header/map.rs) internally from what I can see, which is backed by a HashMap, so it's unordered

daemitus commented 2 years ago

are we trying to preserve the order so it looks identical to the official launcher?

On Tue, Nov 16, 2021 at 7:33 PM goaaats @.***> wrote:

It also uses HTTP's HeaderMap( https://github.com/hyperium/http/blob/master/src/header/map.rs) internally from what I can see, which is backed by a HashMap, so it's unordered

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/goaaats/xivlauncher-neo/issues/11#issuecomment-970932724, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFMTBGFEZ2ZIU7E6K3WI2TUMLZ4LANCNFSM5IAGPJZQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.