mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-22 14:13:08 -05:00
[PR #5773] [MERGED] fix: Chat completion 401 when no Authorization header #8548
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/5773
Author: @HaldiH
Created: 9/27/2024
Status: ✅ Merged
Merged: 9/27/2024
Merged by: @tjbck
Base:
dev← Head:main📝 Commits (1)
eab3078Chat completion 401 when no Authorization header📊 Changes
1 file changed (+16 additions, -4 deletions)
View changed files
📝
backend/open_webui/main.py(+16 -4)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
/api/chat/completionswithout theAuthorizationheader, the server just crashes and creates a stack trace, returning "Internal Server Error" to the calling client because of aKeyError. With this fix, the server sends a 401 to the client with the content{"detail": "Not authenticated"}.Fixed
Authorizationheader. Returns status 401 Not Authorized and{"detail":"Not authenticated"}body if the header is not found.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.