Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 3117b03

Browse files
[Backport 5.5.x] Upgrade cody web experimental package to 0.2.7 (#63863) (#63901)
backport https://github.com/sourcegraph/sourcegraph/pull/63863 S2 Cody Web is broken at the moment. New client-config handlers fail with 401 status because we don't send custom headers, this works for gql queries since they all are POST requests and the browser automatically sends an Origin header for them and this is enough for our auth middleware to check cookies, but with client-config which is rest it's not the case and we should send `X-Requested-Client: Sourcegraph` header to make our auth middleware to pass this query correctly Note that this problem doesn't exist in local builds since we proxy all requests and add `X-Requested-Client: Sourcegraph` in dev server. See Cody latest build PR for more details https://github.com/sourcegraph/cody/pull/4898 ## Test plan CI Co-authored-by: Vova Kulikov <[email protected]>
1 parent 9cf00da commit 3117b03

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

client/web/src/cody/chat/new-chat/NewCodyChatPage.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ export const NewCodyChatPage: FC<NewCodyChatPageProps> = props => {
3131
<CodyPageHeader isSourcegraphDotCom={isSourcegraphDotCom} className={styles.pageHeader} />
3232

3333
<div className={styles.chatContainer}>
34-
<CodyWebChatProvider accessToken="" serverEndpoint={window.location.origin}>
34+
<CodyWebChatProvider
35+
accessToken=""
36+
serverEndpoint={window.location.origin}
37+
customHeaders={window.context.xhrHeaders}
38+
>
3539
<CodyWebHistory>
3640
{history => (
3741
<div className={styles.chatHistory}>

client/web/src/cody/sidebar/new-cody-sidebar/NewCodySidebarWebChat.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const NewCodySidebarWebChat: FC<NewCodySidebarWebChatProps> = memo(functi
4848
chatID={chatID}
4949
initialContext={contextInfo}
5050
serverEndpoint={window.location.origin}
51+
customHeaders={window.context.xhrHeaders}
5152
onNewChatCreated={handleNewChatCreated}
5253
>
5354
<ChatUi />

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
"bloomfilter": "^0.0.18",
334334
"buffer": "^6.0.3",
335335
"classnames": "^2.2.6",
336-
"cody-web-experimental": "^0.2.5",
336+
"cody-web-experimental": "^0.2.7",
337337
"comlink": "^4.3.0",
338338
"copy-to-clipboard": "^3.3.1",
339339
"core-js": "^3.8.2",

pnpm-lock.yaml

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)