public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jturney@sourceware.org>
To: cygwin-apps-cvs@sourceware.org
Subject: [calm - Cygwin server-side packaging maintenance script] branch master, updated. 20200401-9-g49c58c4
Date: Mon, 13 Apr 2020 18:06:28 +0000 (GMT)	[thread overview]
Message-ID: <20200413180628.2FAC4385DC0C@sourceware.org> (raw)




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=49c58c4aeb14b75be801856024d64713e645ddc3

commit 49c58c4aeb14b75be801856024d64713e645ddc3
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Apr 13 16:46:27 2020 +0100

    Add a tool for demonstrating version sort

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/calm.git;h=2d6362640447e1766a0c2dccb2bdc12ed6037c92

commit 2d6362640447e1766a0c2dccb2bdc12ed6037c92
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Apr 13 15:51:36 2020 +0100

    Enhance homepage fixing
    
    Handle:
    * Trivial terminal '/' redirects
    * 308 Permanent Redirect as well as 301 Moved Permanently
    * sites which block urllib's default user-agent


Diff:
---
 calm/fixes.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/calm/fixes.py b/calm/fixes.py
index b42c575..a89896a 100644
--- a/calm/fixes.py
+++ b/calm/fixes.py
@@ -71,6 +71,7 @@ class NoRedirection(urllib.request.HTTPErrorProcessor):
 @functools.lru_cache(maxsize=None)
 def follow_redirect(homepage):
     opener = urllib.request.build_opener(NoRedirection)
+    opener.addheaders = [('User-Agent', 'calm')]
     try:
         response = opener.open(homepage)
         if response.code in [301, 308]:



                 reply	other threads:[~2020-04-13 18:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200413180628.2FAC4385DC0C@sourceware.org \
    --to=jturney@sourceware.org \
    --cc=cygwin-apps-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).