Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

bug: add check for image_hosts #378

Merged
merged 4 commits into from
Mar 29, 2022
Merged

bug: add check for image_hosts #378

merged 4 commits into from
Mar 29, 2022

Conversation

jrconlin
Copy link
Member

Closes: #377

@jrconlin jrconlin requested a review from a team March 24, 2022 22:20
serialize_with = "serialize_hosts",
default
)]
pub(crate) img_hosts: Vec<Vec<String>>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not terribly important but might as well match the field name in the json's prefix

Suggested change
pub(crate) img_hosts: Vec<Vec<String>>,
pub(crate) image_hosts: Vec<Vec<String>>,


if let Err(e) = self.check_image_hosts(img_filter, &mut tile, tags) {
trace!("Rejecting tile: bad img");
metrics.incr_with_tags("filter.adm.err.invalid_img_host", Some(tags));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to be pedantic but one more here, especially because we already have a few metrics with the word "image" in it.

Suggested change
metrics.incr_with_tags("filter.adm.err.invalid_img_host", Some(tags));
metrics.incr_with_tags("filter.adm.err.invalid_image_host", Some(tags));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, good catch! I had done variable refactors for the others and they missed this.

TODO: consider s/img/image/g?
@jrconlin jrconlin merged commit f9649c5 into main Mar 29, 2022
@jrconlin jrconlin deleted the bug/377_img branch March 29, 2022 15:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add filter for image_url elements
2 participants