Using starlette , implement an OriginValidator class in task module.py that inspects incoming HTTP requests…
Using starlette , implement an OriginValidator class in task module.py that inspects incoming HTTP requests…: a task in repo2rlenv-code-instruct (Harbor dataset). OriginValidator wraps a Starlette ASGI app. For each HTTP request: - If the request has no Origin header, forward it unchanged. - If…
The task
`OriginValidator` wraps a Starlette ASGI app. For each HTTP request: - If the request has no `Origin` header, forward it unchanged. - If the `Origin` header value is in the configured `allowed_origins` list, forward it unchanged. - If the `Origin` header is present but **not** allowed, immediately return a `400 Plain…
Part of FineEnvs/repo2rlenv-code-instruct.