Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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
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

fix: Add basic user-agent to all mastodon-bound requests#2277

Merged
shuuji3 merged 5 commits intoelk-zone:mainfromuntitaker:user-agent
Nov 27, 2024

Conversation

untitaker
Copy link
Contributor

Default UA "undici" is not very nice, and I blocked it on my instance to
block a certain botwave.

shuuji3 reacted with thumbs up emoji
Default UA "undici" is not very nice, and I blocked it on my instance toblock a certain botwave.
@stackblitz
Copy link

Review PR in StackBlitz CodeflowRun & review this pull request inStackBlitz Codeflow.

@netlify
Copy link

netlifybot commentedJul 28, 2023
edited
Loading

Deploy Preview forelk-docs canceled.

NameLink
🔨 Latest commit012d17a
🔍 Latest deploy loghttps://app.netlify.com/sites/elk-docs/deploys/6743b65d37e17c00083ff128

@netlify
Copy link

netlifybot commentedJul 28, 2023
edited
Loading

Deploy Preview forelk-zone ready!

NameLink
🔨 Latest commit012d17a
🔍 Latest deploy loghttps://app.netlify.com/sites/elk-zone/deploys/6743b65d397e5e0008e5fbd1
😎 Deploy Previewhttps://deploy-preview-2277--elk-zone.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify site configuration.

@untitakeruntitaker changed the titleAdd basic user-agent to all mastodon-bound requestsfix: Add basic user-agent to all mastodon-bound requestsJul 30, 2023
@@ -24,6 +26,9 @@ export default defineEventHandler(async (event) => {
try {
const result: any = await $fetch(`https://${server}/oauth/token`, {
method: 'POST',
headers: {
'user-agent': APP_NAME,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I guess we should append the version as well,Elk/0.x.x. Could put in the constants module.

I am not sure if we should also include other UA for compatibility, otherwise it LGTM

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

what changes need to be done to the release process so that this constant gets updated?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

You can get the version here

export{version}from'../package.json'

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ah okay, ty. i thought you were suggesting to add a new constant. will fix soon

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I am not sure if we should also include other UA for compatibility, otherwise it LGTM

I believe this should not be necessary, considering you got away with literally hte string"undici" so far

@untitaker
Copy link
ContributorAuthor

@antfu can you take another look?

Copy link
Member

@shuuji3shuuji3 left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you for updating the PR!🙂

I confirmed both fetch requests (/api/v1/apps and/oauth/token) now have the user-agent valueElk/0.15.1 in headers on the Elk server side.

I haven't checked the received request on the server side (Mastodon) by myself but that should be fine. Have you already tested on your server?

@untitaker
Copy link
ContributorAuthor

yes, IIRC I tested it fully. but it's been a long time.

shuuji3 reacted with thumbs up emoji

@shuuji3
Copy link
Member

OK, recent commits only modified user-agent string so it should work as expected. Let's see how it goes on Canary version (https://main.elk.zone) after merging.

@shuuji3shuuji3 added this pull request to themerge queueNov 27, 2024
Merged via the queue intoelk-zone:main with commit302da09Nov 27, 2024
13 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@antfuantfuantfu left review comments

@shuuji3shuuji3shuuji3 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@untitaker@shuuji3@antfu

[8]ページ先頭

©2009-2025 Movatter.jp