-
Notifications
You must be signed in to change notification settings - Fork 2
refactor: Replace location determination with common-rs crate #219
Conversation
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.
Needs a small update for the latest main
src/server/mod.rs
Outdated
@@ -17,7 +21,7 @@ use crate::{ | |||
|
|||
pub mod cache; | |||
pub mod img_storage; | |||
pub mod location; | |||
// pub mod location; |
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.
kill
src/web/handlers.rs
Outdated
tags::Tags, | ||
web::{middleware::sentry as l_sentry, DeviceInfo}, | ||
}; | ||
use actix_web_location::Location; |
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.
nit: should go up top under the actix_web import
src/web/test.rs
Outdated
|
||
/// customizing the settings | ||
fn get_test_settings() -> Settings { | ||
let treq = test::TestRequest::with_uri("/").to_http_request(); | ||
Settings { | ||
maxminddb_loc: Some(MMDB_LOC.to_owned()), | ||
maxminddb_loc: Some(PathBuf::from(MMDB_LOC)), |
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.
nit: could just into this, avoiding the PathBuf import
maxminddb_loc: Some(PathBuf::from(MMDB_LOC)), | |
maxminddb_loc: Some(MMDB_LOC.into()), |
This drops support for GCS provided location headers, which are not being used currently. We should consider adding that feature to the shared crate as well.
83cb06b
to
b362d93
Compare
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.
Sorry @mythmon I totally missed the last update.
I've fixed the merge conflicts here: https://github.com/mozilla-services/contile/tree/extract-location-merge
Shall I push that merge to your branch?
Yes please. Thanks for doing the merge again. |
Description
The location parsing code that Contile had was useful, so I stole it to put into mozilla-services/common-rs#14. This PR re-integrates that code as an external crate. Note that this is currently pulling the crate straight from that PR. That means the other PR should merge and this PR should be updated to point to crates.io before we merge this PR.
This drops support for GCS provided location headers, which are not being used currently. We should consider adding that feature to the shared crate as well.
Testing
MaxMind based location should work exactly the same as before. Non-location features should be unaffected.