From 720d276f4048aaae1fc8287336ccc00716441243 Mon Sep 17 00:00:00 2001 From: Stuart D. Gathman Date: Nov 23 2017 00:36:24 +0000 Subject: headers.get_all() not in python2.6 --- diff --git a/acme-tiny-chain.patch b/acme-tiny-chain.patch index 20f53f8..1c46c7d 100644 --- a/acme-tiny-chain.patch +++ b/acme-tiny-chain.patch @@ -1,9 +1,9 @@ diff -up ./acme_tiny.py.chain ./acme_tiny.py --- ./acme_tiny.py.chain 2017-05-16 03:57:46.000000000 -0400 -+++ ./acme_tiny.py 2017-11-22 12:18:56.963653336 -0500 ++++ ./acme_tiny.py 2017-11-22 15:14:19.270485351 -0500 @@ -1,4 +1,4 @@ -#!/usr/bin/env python -+#!/usr/bin/python3 ++#!/usr/bin/python import argparse, subprocess, json, os, sys, base64, binascii, time, hashlib, re, copy, textwrap, logging try: from urllib.request import urlopen # Python 3 @@ -73,14 +73,14 @@ diff -up ./acme_tiny.py.chain ./acme_tiny.py + certchain = [result] + if chain: + def parse_link_header(line): -+ m = re.search(r"^<([^>]*)>(?:\s*;\s*(.*))?$", line) ++ m = re.search(r"^Link:\s*<([^>]*)>(?:\s*;\s*(.*))?\r\n$", line) + return (m.group(1), dict([(a[0],a[1].strip('"')) + for a in [attr.split("=") + for attr in m.group(2).split("\s*;\s*")]])) + + up = [ + link for link, attr in [ -+ parse_link_header(l) for l in headers.get_all("Link") ++ parse_link_header(l) for l in headers.getallmatchingheaders("Link") + ] if attr['rel'] == 'up' + ] + certchain += [urlopen(url).read() for url in up]