mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 06:03:26 -05:00
[PR #15378] feat: Refactor fetch() usage #10602
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/15378
Author: @jeffposnick
Created: 6/28/2025
Status: 🔄 Open
Base:
dev← Head:fetch-impl📝 Commits (1)
3d3b824feat: Refactor fetch() usage📊 Changes
28 files changed (+330 additions, -300 deletions)
View changed files
📝
src/lib/apis/audio/index.ts(+7 -6)📝
src/lib/apis/auths/index.ts(+25 -24)📝
src/lib/apis/channels/index.ts(+13 -12)📝
src/lib/apis/chats/index.ts(+32 -31)📝
src/lib/apis/configs/index.ts(+15 -14)📝
src/lib/apis/evaluations/index.ts(+9 -8)📝
src/lib/apis/files/index.ts(+9 -8)📝
src/lib/apis/folders/index.ts(+9 -8)📝
src/lib/apis/functions/index.ts(+16 -15)📝
src/lib/apis/groups/index.ts(+6 -5)📝
src/lib/apis/images/index.ts(+8 -7)📝
src/lib/apis/index.ts(+37 -36)📝
src/lib/apis/knowledge/index.ts(+12 -11)📝
src/lib/apis/memories/index.ts(+7 -6)📝
src/lib/apis/models/index.ts(+9 -8)📝
src/lib/apis/notes/index.ts(+6 -5)📝
src/lib/apis/ollama/index.ts(+19 -18)📝
src/lib/apis/openai/index.ts(+14 -13)📝
src/lib/apis/prompts/index.ts(+7 -6)📝
src/lib/apis/retrieval/index.ts(+17 -16)...and 8 more files
📄 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
fetch()behavior used in the web app, to, for example, ensure that specific request headers are always sent, or ensure that fresh authorization credentials are present. Currently, thesefetch()calls are made throughout many individual files in the codebase, and each of thosefetch()calls would have to be modified in order to achieve the desired behavior. This PR refactors things so that a central exportedfetchImplis used throughout the codebase, allowing thatfetchImplto be overridden in one place if needed. By default,fetchImplis set tofetch, so there shouldn't be any change in behavior unless someone takes steps to customize things locally.Added
Changed
fetch()throughout the TypeScript codebase have been replaced with calls to afetchImpl()function, which is exported from./src/lib/fetch.ts. The export definesfetchImplasfetchby default, so there should be no functional change, but this approach will make it simpler to customize thefetch()calls made by Open WebUI in a custom installation.Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.