mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-19 16:56:12 +01:00
feat: add support for request body placeholders in custom endpoint headers
- Add {{LIBRECHAT_BODY_*}} placeholders for conversationId, parentMessageId, messageId
- Update tests to reflect new body placeholder functionality
This commit is contained in:
parent
3508839d6d
commit
eec10bf745
5 changed files with 58 additions and 34 deletions
|
|
@ -426,4 +426,11 @@ describe('resolveHeaders', () => {
|
|||
expect(result['X-Empty']).toBe('');
|
||||
expect(result['X-Boolean']).toBe('true');
|
||||
});
|
||||
|
||||
it('should process LIBRECHAT_BODY placeholders', () => {
|
||||
const body = { conversationId: 'conv-123', parentMessageId: 'parent-456', messageId: 'msg-789' };
|
||||
const headers = { 'X-Conversation': '{{LIBRECHAT_BODY_CONVERSATIONID}}' };
|
||||
const result = resolveHeaders(headers, undefined, undefined, body);
|
||||
expect(result['X-Conversation']).toBe('conv-123');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue