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

Mamba send request with empty user-agent and cause some mirror site refuse to provide files #1169

Closed
TTTPOB opened this issue Sep 17, 2021 · 3 comments · Fixed by #1176
Closed

Comments

@TTTPOB
Copy link

TTTPOB commented Sep 17, 2021

mamba request header looks like

image

and conda request header looks like
image

instead of providing the file, the mirror site just recognize mamba as mobile/spam device and returns

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>清华大学 TUNA 镜像站</title>
  <link href="//cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
  <style>body { padding-top: 40px; }</style>
</head>
<body>
  <div class="container">
    <div class="well">
      <p lang="zh-cn">尊敬的访问者,</p>
      <p lang="en">Dear visitor,</p>
      <p lang="fr">Chère cliente,</p>
      <p lang="ja">訪問者へ 、</p>
      <p>&nbsp;</p>
      <p lang="zh-cn">您好!</p>
      <p lang="en">Hello!</p>
      <p lang="fr">Bonjour!</p>
      <p lang="ja">こんにちは !</p>
      <p>&nbsp;</p>
      <p lang="zh-cn">我们检测到您正在使用移动设备下载镜像站上较大的二进制文件,为防止消耗过多流量,我们建议您改用计算机下载。</p>
      <p lang="en">Your attempt to download a large binary file from a mobile device has been detected. To avoid excessive consumption of data transfer, you are recommended to download it from a computer.</p>
      <p lang="fr">Une tentative de téléchargement d'un fichier binaire de grande taille depuis un appareil mobile a été détectée. Afin d'éviter une consommation excessive de données mobile, nous vous conseillons de recommencer cette action à partir d'un ordinateur.</p>
      <p lang="ja">容量の大きいバイナリファイルが今モバイルデバイスに転送しようとしております、大量のトラフィックが発生するため、コンピュータからのダウンロードをお勧めします。</p>
      <p>&nbsp;</p>
      <p lang="zh-cn">
        如有疑问,请联系
        <a href="mailto:support@tuna.tsinghua.edu.cn">support@tuna.tsinghua.edu.cn</a></p>
      <p lang="en">
        If there are any possible questions, please contact
        <a href="mailto:support@tuna.tsinghua.edu.cn">support@tuna.tsinghua.edu.cn</a>
        .
      </p>
      <p lang="fr">
        Pour plus d'informations, veuillez contacter
        <a href="mailto:support@tuna.tsinghua.edu.cn">support@tuna.tsinghua.edu.cn</a>
        .
      </p>
      <p lang="ja">
        なおご質問などありましたら、
        <a href="mailto:support@tuna.tsinghua.edu.cn">support@tuna.tsinghua.edu.cn</a>
        までご連絡してください。
      </p>
      <p>&nbsp;</p>
      <p>
        <code>00000070 3ab55377120ff6b29f997b8be1a6464e</code>
      </p>
    </div>
  </div>
</body>
</html>
@wolfv
Copy link
Member

wolfv commented Sep 17, 2021

Thanks for the detailed bug report! Are you interested in making a PR for this?

@TTTPOB
Copy link
Author

TTTPOB commented Sep 18, 2021

Thanks for the detailed bug report! Are you interested in making a PR for this?

I want to help but I am not familiar with mamba development and lack the ability to find where to modify the request sending process..................

@wolfv
Copy link
Member

wolfv commented Sep 20, 2021

@TTTPOB this might be a good place for adding default headers:

curl_easy_setopt(

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

Successfully merging a pull request may close this issue.

2 participants