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: improve input validation to allow quotes for strategy parameter #457

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

jordan-homan
Copy link
Contributor

@jordan-homan jordan-homan commented Sep 9, 2024

Improve input validation to allow quotes for strategy parameter

Updated the strategy parameter to allow " or ' as input wrapped around valid input to reduce 4xx errors.

Testing

Invoked CURL and REST requests passing values such as 'fast', "fast", and fast for parameter values for the strategy.

curl -X POST "PATH_TO_API" \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H 'unstructured-api-key: KEY' \
  -F "files=@/path_to_file.pdf" \
  -F "strategy='fast'" \
  -F "split-pdf-page=True" \
  -F "split-pdf-allow-failed=True" \
  -F "split-pdf-concurrency-level=15"

Added unit tests (passing).

@jordan-homan jordan-homan force-pushed the improve_strategy_validation branch 4 times, most recently from 82eae26 to a9bd947 Compare September 9, 2024 17:09
@jordan-homan jordan-homan marked this pull request as ready for review September 9, 2024 19:28
Copy link
Collaborator

@awalker4 awalker4 left a comment

Choose a reason for hiding this comment

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

LGTM! Can you add a note at the top of changelog.md? I believe the last release was just cut, in which case you can:

  • Start a new section with 0.0.xx-dev0
  • Run make version-sync to copy the new version string into the code. You can use make check to verify that it's happy.

@jordan-homan jordan-homan force-pushed the improve_strategy_validation branch from a9bd947 to 4d6c7ab Compare September 11, 2024 19:18
@jordan-homan jordan-homan force-pushed the improve_strategy_validation branch from 4d6c7ab to 78f56e1 Compare September 11, 2024 19:23
@jordan-homan jordan-homan merged commit 456bb9b into main Sep 12, 2024
6 checks passed
@jordan-homan jordan-homan deleted the improve_strategy_validation branch September 12, 2024 14:21
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.

2 participants