Skip to content

Commit

Permalink
Fix: properly trim websites with space (#535)
Browse files Browse the repository at this point in the history
Signed-off-by: Daishan Peng <[email protected]>
  • Loading branch information
StrongMonkey authored Nov 11, 2024
1 parent 99de558 commit d49baa6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ui/admin/app/components/knowledge/AddSourceModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ const AddSourceModal: FC<AddSourceModalProps> = ({

const handleAddWebsite = async () => {
if (newWebsite) {
const trimmedWebsite = newWebsite.trim();
const formattedWebsite =
newWebsite.startsWith("http://") ||
newWebsite.startsWith("https://")
? newWebsite.trim()
: `https://${newWebsite.trim()}`;
trimmedWebsite.startsWith("http://") ||
trimmedWebsite.startsWith("https://")
? trimmedWebsite
: `https://${trimmedWebsite}`;

const res = await KnowledgeService.createKnowledgeSource(agentId, {
websiteCrawlingConfig: {
Expand Down

0 comments on commit d49baa6

Please sign in to comment.