Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove dictionary count limit from viceroy #227

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions lib/src/config/dictionaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ mod deserialization {
use {
super::{DictionariesConfig, Dictionary, DictionaryName},
crate::{
config::limits::{
DICTIONARY_ITEM_KEY_MAX_LEN, DICTIONARY_ITEM_VALUE_MAX_LEN, DICTIONARY_MAX_LEN,
},
config::limits::{DICTIONARY_ITEM_KEY_MAX_LEN, DICTIONARY_ITEM_VALUE_MAX_LEN},
error::{DictionaryConfigError, FastlyConfigError},
},
std::{collections::HashMap, path::PathBuf, str::FromStr},
Expand Down Expand Up @@ -225,11 +223,6 @@ mod deserialization {
dict: &HashMap<String, String>,
) -> Result<(), DictionaryConfigError> {
info!("checking if dictionary adheres to Fastly's API",);
if dict.len() > DICTIONARY_MAX_LEN {
return Err(DictionaryConfigError::DictionaryCountTooLong {
size: DICTIONARY_MAX_LEN.try_into().unwrap(),
});
}

for (key, value) in dict.iter() {
if key.chars().count() > DICTIONARY_ITEM_KEY_MAX_LEN {
Expand Down
1 change: 0 additions & 1 deletion lib/src/config/limits.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// From https://docs.fastly.com/en/guides/resource-limits#vcl-and-configuration-limits
pub const DICTIONARY_MAX_LEN: usize = 1000;
pub const DICTIONARY_ITEM_KEY_MAX_LEN: usize = 256;
pub const DICTIONARY_ITEM_VALUE_MAX_LEN: usize = 8000;