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

Why your library make unneeded request? #118

Open
thander opened this issue Nov 6, 2024 · 1 comment
Open

Why your library make unneeded request? #118

thander opened this issue Nov 6, 2024 · 1 comment

Comments

@thander
Copy link

thander commented Nov 6, 2024

Are you intercept my requests?
Снимок экрана 2024-11-06 в 23 28 28

@fa0311
Copy link
Owner

fa0311 commented Nov 6, 2024

In twitter-openapi-typescript, two additional requests are made:

  1. Fetching default argument values:
    The library retrieves default argument values from an external JSON file to address limited support for default arguments in the OpenAPI specification and openapi-generator.
    You can find this JSON file here: placeholder.json.
    Since an insertion of malicious code in this file could cause issues, we use a fixed commit hash to mitigate that risk.

  2. Fetching the latest User-Agent:
    The library also retrieves an updated User-Agent header from this file: header.json.
    This ensures compliance with Twitter’s requirements, as using an outdated User-Agent could result in account suspension.
    Unlike the placeholder file, this file does not use a fixed commit hash because it must stay up-to-date.
    Updates are managed by me and a GitHub Action, ensuring the latest User-Agent is used while minimizing risks from malicious code.

If these additional requests are an issue, I recommend initializing the library with TwitterOpenApiClient instead of TwitterOpenApi: TwitterOpenApiClient.

We also welcome pull requests if you'd like to contribute improvements!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants