chore: validate unknown unit primitive header
What does this merge request do and why?
This MR adds validation for unknown unit primitive value. This also ensures the correct enum type is passed into the can
method.
How to set up and validate locally
- Check out to this merge request's branch.
- Run the application.
poetry run ai_gateway
- Send an invalid cURL request to check the response.
curl --request POST \ --url http://ai-gateway.gdk.test:5052/v1/proxy/anthropic/ \ --header 'Content-Type: application/json' \ --header 'x-gitlab-unit-primitive: odd_unit' {"detail":"Unknown unit primitive header odd_unit"}
Merge request checklist
-
Tests added for new functionality. If not, please raise an issue to follow up. -
Documentation added/updated, if needed.
Edited by Tan Le