Merge pull request #44 from Moonlite-Media/making-status-endpoint-public

This commit is contained in:
Darrel Pol 2024-11-22 21:26:24 -06:00 committed by GitHub
commit 074c15f356
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -42,7 +42,7 @@ jobs:
- name: Build and tag Docker image
run: |
# Build the Docker image
docker build -t ${{ secrets.STAGING_ECR_URI }}:$IMAGE_TAG .
docker build --no-cache -t ${{ secrets.STAGING_ECR_URI }}:$IMAGE_TAG .
# Tag the image as 'latest'
docker tag ${{ secrets.STAGING_ECR_URI }}:$IMAGE_TAG ${{ secrets.STAGING_ECR_URI }}:latest

View file

@ -12,6 +12,11 @@ class BasicAuthMiddleware(BaseHTTPMiddleware):
self.password = password
async def dispatch(self, request, call_next):
# Allow unauthenticated access to the `/sdapi/v1/status` endpoint
if request.url.path == "/sdapi/v1/status":
return await call_next(request)
# Extract the Authorization header
auth_header = request.headers.get("Authorization") or request.headers.get("authorization")
if not auth_header or not auth_header.startswith("Basic "):