Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add customizable header command#119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
code-asher merged 8 commits intomainfromasher/credentials-process
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Fix merging headers into config object
First, I replaced the wrong line, needed to replace the second one.Secondly, seems you cannot actually spread like this becauseconfig.headers actually has a bunch of functions on it.
  • Loading branch information
@code-asher
code-asher committedAug 18, 2023
commitc67bca29653dabd88b7f8b4905b25e11e96073a1
11 changes: 4 additions & 7 deletionssrc/extension.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,13 +61,10 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {

// Add headers from the header command.
axios.interceptors.request.use(async (config) => {
return {
...config,
headers: {
...(await storage.getHeaders()),
...creds.headers,
},
}
Object.entries(await storage.getHeaders()).forEach(([key, value]) => {
config.headers[key] = value
})
return config
})

const myWorkspacesProvider = new WorkspaceProvider(WorkspaceQuery.Mine, storage)
Expand Down
2 changes: 1 addition & 1 deletionsrc/storage.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -393,7 +393,7 @@ export class Storage {
}
}

public async getHeaders(url = this.getURL()): Promise<Record<string, string> | undefined> {
public async getHeaders(url = this.getURL()): Promise<Record<string, string>> {
return getHeaders(url, vscode.workspace.getConfiguration().get("coder.headerCommand"), this)
}
}
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp