Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to save the link on twitter.com #46

Closed
eiurur opened this issue Oct 11, 2020 · 7 comments
Closed

Failure to save the link on twitter.com #46

eiurur opened this issue Oct 11, 2020 · 7 comments
Labels

Comments

@eiurur
Copy link
Owner

eiurur commented Oct 11, 2020

Access to XMLHttpRequest at 'https://kawpaa.eiurur.xyz/api/posts' from origin 'https://twitter.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

https://twitter.com/Klaius/status/1315233598652379136

@eiurur eiurur added the bug label Oct 11, 2020
@eiurur
Copy link
Owner Author

eiurur commented Oct 13, 2020

全然わからん

2020-10-14_02-42-41

@eiurur
Copy link
Owner Author

eiurur commented Oct 13, 2020

PostBodyに渡すjsonのcontentキーのデータが100KBを超えている。contentを空にしたところ成功。

@eiurur
Copy link
Owner Author

eiurur commented Oct 13, 2020

@eiurur
Copy link
Owner Author

eiurur commented Oct 13, 2020

  • axiosのバージョンアップ実行
  • maxContentLength, maxBodyLengthを指定
    • 変化なし。
  getAxios() {
    return axios.create({
      baseURL: this.getBaseURL(),
      headers: {
        'Access-Control-Allow-Origin': '*',
      },
      maxContentLength: Infinity,
      maxBodyLength: Infinity,
    });
  }

  • bodyParserのraw(), text()を追加、limitオプションに'10mb'を指定
    • 変化なし。

@eiurur
Copy link
Owner Author

eiurur commented Oct 14, 2020

chrome_2020-10-14_23-46-35

chrome_2020-10-14_23-46-54

@eiurur
Copy link
Owner Author

eiurur commented Oct 14, 2020

@eiurur
Copy link
Owner Author

eiurur commented Oct 14, 2020

完璧に直りました。

@eiurur eiurur closed this as completed Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant