Skip to content

Conversation

@KeepWannabe
Copy link

Features

  • Validates URLs against configurable whitelisted domains
  • Ensures URLs point to accepted image formats (.png, .jpg, .jpeg)
  • Supports URL parameters after the file extension
  • Configuration via locale files for easy maintenance
  • Lightweight implementation with no external dependencies

Implementation

The validator uses a function-based approach rather than complex regex patterns, making it more maintainable and adaptable for different scenarios. The whitelisted domains and accepted file extensions are stored in locale files, allowing for easy updates without code changes. This solution was created after discovering the limitations of Lua's native pattern matching when dealing with complex URL validation requirements.

## Features

- Validates URLs against configurable whitelisted domains
- Ensures URLs point to accepted image formats (.png, .jpg, .jpeg)
- Supports URL parameters after the file extension
- Configuration via locale files for easy maintenance
- Lightweight implementation with no external dependencies

## Implementation

The validator uses a function-based approach rather than complex regex patterns, making it more maintainable and adaptable for different scenarios. The whitelisted domains and accepted file extensions are stored in locale files, allowing for easy updates without code changes.
This solution was created after discovering the limitations of Lua's native pattern matching when dealing with complex URL validation requirements.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant