[][src]Function fastly::backend::validate_backend

pub fn validate_backend(backend: &str) -> Result<(), BackendError>

Validate that a string looks like an acceptable Backend value.

Note that this is not meant to be a filter for things that could cause security issues, it is only meant to catch errors before the hostcalls do in order to yield friendlier error messages.

This function will return a BackendError if an invalid name was given.

Backend names:

  • cannot be empty
  • cannot be longer than 255 characters
  • cannot ASCII control characters such as '\n' or DELETE.
  • cannot contain special Unicode characters
  • should only contain visible ASCII characters or spaces