New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 810207 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Mar 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

cros_sdk doesn't work on older firmware branches

Project Member Reported by amstan@chromium.org, Feb 8 2018

Issue description

Reproductions steps:
/mnt/ssdraid% mkdir firmware-veyron
/mnt/ssdraid% cd firmware-veyron
/mnt/ssdraid/firmware-veyron% repo init -u https://chrome-internal.googlesource.com/chromeos/manifest-internal.git --repo-url='https://chromium.googlesource.com/external/repo.git' -b firmware-veyron-6588.B
...snip...
/mnt/ssdraid/firmware-veyron% repo sync -j 10
...snip...
/mnt/ssdraid/firmware-veyron% cros_sdk
cros_sdk: Unhandled exception:
Traceback (most recent call last):
  File "/mnt/ssdraid/firmware-veyron/chromite/bin/cros_sdk", line 132, in <module>
    commandline.ScriptWrapperMain(FindTarget)
  File "/mnt/ssdraid/firmware-veyron/chromite/lib/commandline.py", line 647, in ScriptWrapperMain
    ret = target(argv[1:])
  File "/mnt/ssdraid/firmware-veyron/chromite/scripts/cros_sdk.py", line 524, in main
    _ReExecuteIfNeeded([sys.argv[0]] + argv)
  File "/mnt/ssdraid/firmware-veyron/chromite/scripts/cros_sdk.py", line 416, in _ReExecuteIfNeeded
    cgroups.Cgroup.InitSystem()
  File "/mnt/ssdraid/firmware-veyron/chromite/lib/cros_build_lib.py", line 1503, in f
    val = functor(obj)
  File "/mnt/ssdraid/firmware-veyron/chromite/lib/cgroups.py", line 145, in InitSystem
    _EnsureMounted(cls.CGROUP_ROOT, cgroup_root_args)
  File "/mnt/ssdraid/firmware-veyron/chromite/lib/cgroups.py", line 134, in _EnsureMounted
    osutils.SafeMakedirs(mnt, sudo=True)
  File "/mnt/ssdraid/firmware-veyron/chromite/lib/osutils.py", line 164, in SafeMakedirs
    redirect_stderr=True, redirect_stdout=True)
  File "/mnt/ssdraid/firmware-veyron/chromite/lib/cros_build_lib.py", line 267, in SudoRunCommand
    return RunCommand(cmd, **kwargs)
  File "/mnt/ssdraid/firmware-veyron/chromite/lib/cros_build_lib.py", line 616, in RunCommand
    raise RunCommandError(msg, cmd_result)
chromite.lib.cros_build_lib.RunCommandError: return code: 1
mkdir: cannot create directory &#8216;/sys/fs/cgroup/cros&#8217;: Read-only file system

Failed command "mkdir -p --mode 0775 /sys/fs/cgroup/cros", cwd=None, extra env=None
/mnt/ssdraid/firmware-veyron%

Maybe this is due to new glinux?
Maybe there's a fix in tot right now(since that still works), but it never got cherry-picked to older branches.

This is kinda important for firmware workflows, since there's no other ways to locally build from firmware branches.
 
Showing comments 77 - 176 of 176 Older
Project Member

Comment 77 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-zako-5220.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/06aad3fc206af0eedd9f901208e4699cd5c3ea54

commit 06aad3fc206af0eedd9f901208e4699cd5c3ea54
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:38 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139765
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/06aad3fc206af0eedd9f901208e4699cd5c3ea54/scripts/cros_sdk.py

Project Member

Comment 78 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/21fcecd543fa31d3140b3b4df4a4a30183932210

commit 21fcecd543fa31d3140b3b4df4a4a30183932210
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:39 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139766
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/21fcecd543fa31d3140b3b4df4a4a30183932210/scripts/cros_sdk.py

Project Member

Comment 79 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-zako-5219.17.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/56f9dbce5d774c58a9c57fc16240edeee0025a32

commit 56f9dbce5d774c58a9c57fc16240edeee0025a32
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:40 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139767
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/56f9dbce5d774c58a9c57fc16240edeee0025a32/scripts/cros_sdk.py

Project Member

Comment 80 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/f22d7eba8e3f6d71db49b46c7ce97e73c8848135

commit f22d7eba8e3f6d71db49b46c7ce97e73c8848135
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:41 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139768
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/f22d7eba8e3f6d71db49b46c7ce97e73c8848135/scripts/cros_sdk.py

Project Member

Comment 81 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-zako-5219.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/ed06ee89289acf24d12a98a6cdebefc1545db8e9

commit ed06ee89289acf24d12a98a6cdebefc1545db8e9
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:41 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139769
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ed06ee89289acf24d12a98a6cdebefc1545db8e9/scripts/cros_sdk.py

Project Member

Comment 82 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/94fa38fe154e051710ff446f7192fe6eb179b500

commit 94fa38fe154e051710ff446f7192fe6eb179b500
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:42 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139770
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/94fa38fe154e051710ff446f7192fe6eb179b500/scripts/cros_sdk.py

Project Member

Comment 83 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-clapper-5218.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/93a88b6f8510997e98cd8d0322f3cf820d4a89a7

commit 93a88b6f8510997e98cd8d0322f3cf820d4a89a7
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:43 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139771
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/93a88b6f8510997e98cd8d0322f3cf820d4a89a7/scripts/cros_sdk.py

Project Member

Comment 84 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/f029e792937576f14598a3c5571ee053043269f4

commit f029e792937576f14598a3c5571ee053043269f4
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:43 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139772
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/f029e792937576f14598a3c5571ee053043269f4/scripts/cros_sdk.py

Project Member

Comment 85 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-glimmer-5217.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/0b865203c286db587f076a11520108664c869a0c

commit 0b865203c286db587f076a11520108664c869a0c
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:44 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139773
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/0b865203c286db587f076a11520108664c869a0c/scripts/cros_sdk.py

Project Member

Comment 86 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/3b9fa9b5761bc7724123672fcdac47656107a0e9

commit 3b9fa9b5761bc7724123672fcdac47656107a0e9
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:45 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139774
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/3b9fa9b5761bc7724123672fcdac47656107a0e9/scripts/cros_sdk.py

Project Member

Comment 87 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-heli-5216.392.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/6445b3e6d700703a3486f9815a7ffa52c50116d5

commit 6445b3e6d700703a3486f9815a7ffa52c50116d5
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:45 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139775
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/6445b3e6d700703a3486f9815a7ffa52c50116d5/scripts/cros_sdk.py

Project Member

Comment 88 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/51d98965fe488031ccfb3b26db86c643c1c53e06

commit 51d98965fe488031ccfb3b26db86c643c1c53e06
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:46 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139776
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/51d98965fe488031ccfb3b26db86c643c1c53e06/scripts/cros_sdk.py

Project Member

Comment 89 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-ninja-5216.383.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/1a6a84862e4598b39085bb1fa40599bc9b013ab2

commit 1a6a84862e4598b39085bb1fa40599bc9b013ab2
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:47 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139777
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/1a6a84862e4598b39085bb1fa40599bc9b013ab2/scripts/cros_sdk.py

Project Member

Comment 90 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/7a57a3ea2c792faf87e425b466b2b081c0bcfe9a

commit 7a57a3ea2c792faf87e425b466b2b081c0bcfe9a
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:47 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139778
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/7a57a3ea2c792faf87e425b466b2b081c0bcfe9a/scripts/cros_sdk.py

Project Member

Comment 91 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-sumo-5216.382.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/5b29d6e0b4e95e4c64214b20eb5ef03084adc4e8

commit 5b29d6e0b4e95e4c64214b20eb5ef03084adc4e8
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:48 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139779
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/5b29d6e0b4e95e4c64214b20eb5ef03084adc4e8/scripts/cros_sdk.py

Project Member

Comment 92 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/639ed5582f0a13d82484f8ae6bba9ec52a8eacea

commit 639ed5582f0a13d82484f8ae6bba9ec52a8eacea
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:49 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139780
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/639ed5582f0a13d82484f8ae6bba9ec52a8eacea/scripts/cros_sdk.py

Project Member

Comment 93 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-orco-5216.362.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/f0d69699d52d44336b71ce3b194f81b0b7bca5fd

commit f0d69699d52d44336b71ce3b194f81b0b7bca5fd
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:50 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139781
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/f0d69699d52d44336b71ce3b194f81b0b7bca5fd/scripts/cros_sdk.py

Project Member

Comment 94 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/8dbda7d3a7947343af86526c5785e30af4786ef1

commit 8dbda7d3a7947343af86526c5785e30af4786ef1
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:50 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139782
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/8dbda7d3a7947343af86526c5785e30af4786ef1/scripts/cros_sdk.py

Project Member

Comment 95 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-banjo-5216.334.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/ee5586c24a67488d6752909f45ec190280615aa7

commit ee5586c24a67488d6752909f45ec190280615aa7
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:51 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139783
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ee5586c24a67488d6752909f45ec190280615aa7/scripts/cros_sdk.py

Project Member

Comment 96 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/fd694730f524a7e5400de18f13739646f50af4d9

commit fd694730f524a7e5400de18f13739646f50af4d9
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:52 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139784
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/fd694730f524a7e5400de18f13739646f50af4d9/scripts/cros_sdk.py

Project Member

Comment 97 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-candy-5216.310.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/47cb09a25d4e724e5b8bceff4a13c21ce161d86c

commit 47cb09a25d4e724e5b8bceff4a13c21ce161d86c
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:52 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139785
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/47cb09a25d4e724e5b8bceff4a13c21ce161d86c/scripts/cros_sdk.py

Project Member

Comment 98 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/2e04e470af39530152375f3cbd60d7b7bce56137

commit 2e04e470af39530152375f3cbd60d7b7bce56137
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:53 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139786
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/2e04e470af39530152375f3cbd60d7b7bce56137/scripts/cros_sdk.py

Project Member

Comment 99 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-winky-5216.265.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/40678d4551df71d5551d58bc211f0f7642a1d120

commit 40678d4551df71d5551d58bc211f0f7642a1d120
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:54 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139787
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/40678d4551df71d5551d58bc211f0f7642a1d120/scripts/cros_sdk.py

Project Member

Comment 100 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/d896a59da1c9354fc8b2661eb736a86602f9de6c

commit d896a59da1c9354fc8b2661eb736a86602f9de6c
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:55 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139788
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/d896a59da1c9354fc8b2661eb736a86602f9de6c/scripts/cros_sdk.py

Project Member

Comment 101 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-gnawty-5216.239.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/8b59bb1b18d00ac5a1b0fccd7da7f96c20574bbc

commit 8b59bb1b18d00ac5a1b0fccd7da7f96c20574bbc
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:55 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139789
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/8b59bb1b18d00ac5a1b0fccd7da7f96c20574bbc/scripts/cros_sdk.py

Project Member

Comment 102 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/f3aae86930b272400c902e179b92444563ac7718

commit f3aae86930b272400c902e179b92444563ac7718
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:56 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139790
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/f3aae86930b272400c902e179b92444563ac7718/scripts/cros_sdk.py

Project Member

Comment 103 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-swanky-5216.238.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/d82b874ac05ad02ca10da287e824e4d47f29c3b2

commit d82b874ac05ad02ca10da287e824e4d47f29c3b2
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:57 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139791
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/d82b874ac05ad02ca10da287e824e4d47f29c3b2/scripts/cros_sdk.py

Project Member

Comment 104 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/9fb44ad2278ad5140d3ad3ae00d24bd51ea491d3

commit 9fb44ad2278ad5140d3ad3ae00d24bd51ea491d3
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:57 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139792
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/9fb44ad2278ad5140d3ad3ae00d24bd51ea491d3/scripts/cros_sdk.py

Project Member

Comment 105 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-kip-5216.227.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/45297ea1dfdfa338665ead56881002245489c15f

commit 45297ea1dfdfa338665ead56881002245489c15f
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:58 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139793
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/45297ea1dfdfa338665ead56881002245489c15f/scripts/cros_sdk.py

Project Member

Comment 106 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/cd4d7b1dc84a3562565d130e2e7ca8dba05fde0c

commit cd4d7b1dc84a3562565d130e2e7ca8dba05fde0c
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:59 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139794
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/cd4d7b1dc84a3562565d130e2e7ca8dba05fde0c/scripts/cros_sdk.py

Project Member

Comment 107 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-expresso-5216.223.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/e0289074fd1be3e4bc473defb98e73b050fe43bd

commit e0289074fd1be3e4bc473defb98e73b050fe43bd
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:11:59 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139795
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/e0289074fd1be3e4bc473defb98e73b050fe43bd/scripts/cros_sdk.py

Project Member

Comment 108 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/1852caf5d0db4deb92d8ecbb76ae274a56e716bd

commit 1852caf5d0db4deb92d8ecbb76ae274a56e716bd
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:00 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139796
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/1852caf5d0db4deb92d8ecbb76ae274a56e716bd/scripts/cros_sdk.py

Project Member

Comment 109 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-quawks-5216.204.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/cd88f8ff13f51b3ac6524b7675311db16bcd11bb

commit cd88f8ff13f51b3ac6524b7675311db16bcd11bb
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:01 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139797
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/cd88f8ff13f51b3ac6524b7675311db16bcd11bb/scripts/cros_sdk.py

Project Member

Comment 110 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/eb54697ff7d3b4c29e97daaf0fde9541a815525a

commit eb54697ff7d3b4c29e97daaf0fde9541a815525a
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:02 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139798
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/eb54697ff7d3b4c29e97daaf0fde9541a815525a/scripts/cros_sdk.py

Project Member

Comment 111 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-enguarde-5216.201.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/256956907cf8a42b2ebe4803fe3223c3515ecbd9

commit 256956907cf8a42b2ebe4803fe3223c3515ecbd9
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:02 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139799
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/256956907cf8a42b2ebe4803fe3223c3515ecbd9/scripts/cros_sdk.py

Project Member

Comment 112 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/87114471a56912633fb44ce3bfd8e923cd7d3ae2

commit 87114471a56912633fb44ce3bfd8e923cd7d3ae2
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:03 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139800
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/87114471a56912633fb44ce3bfd8e923cd7d3ae2/scripts/cros_sdk.py

Project Member

Comment 113 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-clapper-5216.199.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/58c4149d05f1ebfb7f12ebc0b704252b9d54503b

commit 58c4149d05f1ebfb7f12ebc0b704252b9d54503b
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:04 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139801
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/58c4149d05f1ebfb7f12ebc0b704252b9d54503b/scripts/cros_sdk.py

Project Member

Comment 114 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/ba4eadaa95707ed3a0811159cf4e807d89048b1b

commit ba4eadaa95707ed3a0811159cf4e807d89048b1b
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:04 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139802
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ba4eadaa95707ed3a0811159cf4e807d89048b1b/scripts/cros_sdk.py

Project Member

Comment 115 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-glimmer-5216.198.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/8af1a10e534ac10e90eba80b1d0d3b338c9d8568

commit 8af1a10e534ac10e90eba80b1d0d3b338c9d8568
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:06 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139803
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/8af1a10e534ac10e90eba80b1d0d3b338c9d8568/scripts/cros_sdk.py

Project Member

Comment 116 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/0a5d0f1521b129a31fa30048cb409aa5bd3a2996

commit 0a5d0f1521b129a31fa30048cb409aa5bd3a2996
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:07 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139804
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/0a5d0f1521b129a31fa30048cb409aa5bd3a2996/scripts/cros_sdk.py

Project Member

Comment 117 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-squawks-5216.152.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/cf9e63659351bbeb33843356ea7bda932f6d3f91

commit cf9e63659351bbeb33843356ea7bda932f6d3f91
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:08 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139805
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/cf9e63659351bbeb33843356ea7bda932f6d3f91/scripts/cros_sdk.py

Project Member

Comment 118 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/034d8d0f2bd41afba6cece73edb6398f877e6ad2

commit 034d8d0f2bd41afba6cece73edb6398f877e6ad2
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:08 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139806
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/034d8d0f2bd41afba6cece73edb6398f877e6ad2/scripts/cros_sdk.py

Project Member

Comment 119 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-winky-5216.1.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/27493ae39db17f58a71710c9bfae772cfac1e42d

commit 27493ae39db17f58a71710c9bfae772cfac1e42d
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:09 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139807
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/27493ae39db17f58a71710c9bfae772cfac1e42d/scripts/cros_sdk.py

Project Member

Comment 120 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/9fecaf814409da63e2b4d1e519731b426e2fb909

commit 9fecaf814409da63e2b4d1e519731b426e2fb909
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:10 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139808
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/9fecaf814409da63e2b4d1e519731b426e2fb909/scripts/cros_sdk.py

Project Member

Comment 121 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-rambi-5216.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/0e6392e2ce7689e9ec7f2ed78758078f87183a5c

commit 0e6392e2ce7689e9ec7f2ed78758078f87183a5c
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:11 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139809
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/0e6392e2ce7689e9ec7f2ed78758078f87183a5c/scripts/cros_sdk.py

Project Member

Comment 122 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/24402214215a4a603da42191701848aa771c15af

commit 24402214215a4a603da42191701848aa771c15af
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:11 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139810
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/24402214215a4a603da42191701848aa771c15af/scripts/cros_sdk.py

Project Member

Comment 123 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-beltino-5140.14.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/f64831d68697ca93ac27a47a37c3d2be2b8fbbf9

commit f64831d68697ca93ac27a47a37c3d2be2b8fbbf9
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:12 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139811
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/f64831d68697ca93ac27a47a37c3d2be2b8fbbf9/scripts/cros_sdk.py

Project Member

Comment 124 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/291458638576f15a60f41ee93545aa79bd596ace

commit 291458638576f15a60f41ee93545aa79bd596ace
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:13 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139812
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/291458638576f15a60f41ee93545aa79bd596ace/scripts/cros_sdk.py

Project Member

Comment 125 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-monroe-5140.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/85db4fb97b9342d5ac2346d03da01188564484d8

commit 85db4fb97b9342d5ac2346d03da01188564484d8
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:13 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139813
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/85db4fb97b9342d5ac2346d03da01188564484d8/scripts/cros_sdk.py

Project Member

Comment 126 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/708ffc956f00ad282954bc0ff1776d03657c40fb

commit 708ffc956f00ad282954bc0ff1776d03657c40fb
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:14 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139814
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/708ffc956f00ad282954bc0ff1776d03657c40fb/scripts/cros_sdk.py

Project Member

Comment 127 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-bolt_kirby-4979.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/b358ff6452ed873c2ac001860d93cc7fbfc1ff70

commit b358ff6452ed873c2ac001860d93cc7fbfc1ff70
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:15 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139816
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/b358ff6452ed873c2ac001860d93cc7fbfc1ff70/scripts/cros_sdk.py

Project Member

Comment 128 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/3a9cb21762d594d97b5f04b312c4b6b7519c1333

commit 3a9cb21762d594d97b5f04b312c4b6b7519c1333
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:15 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139817
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/3a9cb21762d594d97b5f04b312c4b6b7519c1333/scripts/cros_sdk.py

Project Member

Comment 129 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-monroe-4921.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/99fce1e55ced02c60cfe0edc37b9ec47addb4cdb

commit 99fce1e55ced02c60cfe0edc37b9ec47addb4cdb
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:16 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139818
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/99fce1e55ced02c60cfe0edc37b9ec47addb4cdb/scripts/cros_sdk.py

Project Member

Comment 130 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/73cdd12101f2ce3ef4fd8cad577c38af4c083ad0

commit 73cdd12101f2ce3ef4fd8cad577c38af4c083ad0
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:17 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139819
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/73cdd12101f2ce3ef4fd8cad577c38af4c083ad0/scripts/cros_sdk.py

Project Member

Comment 131 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-panther-4920.24.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/9b12d1c1513577935b01f0708a77010076ace252

commit 9b12d1c1513577935b01f0708a77010076ace252
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:17 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139820
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/9b12d1c1513577935b01f0708a77010076ace252/scripts/cros_sdk.py

Project Member

Comment 132 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/5b848354483dfc72a71abe0606eb4d249bd813fa

commit 5b848354483dfc72a71abe0606eb4d249bd813fa
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:18 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139821
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/5b848354483dfc72a71abe0606eb4d249bd813fa/scripts/cros_sdk.py

Project Member

Comment 133 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-panther-4920.23.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/58f698f249bbd8c2332920d5112143db5cee65c1

commit 58f698f249bbd8c2332920d5112143db5cee65c1
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:19 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139822
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/58f698f249bbd8c2332920d5112143db5cee65c1/scripts/cros_sdk.py

Project Member

Comment 134 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/97051aee28621a5f9a4f924ff36b30fddc69fbc2

commit 97051aee28621a5f9a4f924ff36b30fddc69fbc2
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:20 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139823
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/97051aee28621a5f9a4f924ff36b30fddc69fbc2/scripts/cros_sdk.py

Project Member

Comment 135 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-samus-4788.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/9166c14426bc3044bcbcf0e6c87854f23e3c2f5f

commit 9166c14426bc3044bcbcf0e6c87854f23e3c2f5f
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:20 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139824
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/9166c14426bc3044bcbcf0e6c87854f23e3c2f5f/scripts/cros_sdk.py

Project Member

Comment 136 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/e6d498e538ed255ae54b9977a5a6021f1e09485c

commit e6d498e538ed255ae54b9977a5a6021f1e09485c
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:21 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139825
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/e6d498e538ed255ae54b9977a5a6021f1e09485c/scripts/cros_sdk.py

Project Member

Comment 137 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-daisy-4731.81.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/fda70b22be961760e5758dfd675afece969a63f7

commit fda70b22be961760e5758dfd675afece969a63f7
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:22 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139826
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/fda70b22be961760e5758dfd675afece969a63f7/scripts/cros_sdk.py

Project Member

Comment 138 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/182aee8699ba0e884309e3f180dbc78ea5a701fa

commit 182aee8699ba0e884309e3f180dbc78ea5a701fa
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:12:22 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139827
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/182aee8699ba0e884309e3f180dbc78ea5a701fa/scripts/cros_sdk.py

Project Member

Comment 139 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-pit-4482.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/ca47a7b161563e30d8ffcab50d2efa54f3f48aab

commit ca47a7b161563e30d8ffcab50d2efa54f3f48aab
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:11 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139829
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ca47a7b161563e30d8ffcab50d2efa54f3f48aab/scripts/cros_sdk.py

Project Member

Comment 140 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/4c292fb0e4c70325e055a85776668f0087ae5ecf

commit 4c292fb0e4c70325e055a85776668f0087ae5ecf
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:12 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139830
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/4c292fb0e4c70325e055a85776668f0087ae5ecf/scripts/cros_sdk.py

Project Member

Comment 141 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-pit-4471.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/8e832534fa863a225904bd75fd1038a66ff766ca

commit 8e832534fa863a225904bd75fd1038a66ff766ca
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:12 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139831
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/8e832534fa863a225904bd75fd1038a66ff766ca/scripts/cros_sdk.py

Project Member

Comment 142 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/27f18269ed41333634a0b613e80653f697bfc09e

commit 27f18269ed41333634a0b613e80653f697bfc09e
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:13 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139832
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/27f18269ed41333634a0b613e80653f697bfc09e/scripts/cros_sdk.py

Project Member

Comment 143 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-pit-4390.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/3bc2997113c337753150ae9b8921e7f5c4c819ca

commit 3bc2997113c337753150ae9b8921e7f5c4c819ca
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:14 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139853
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/3bc2997113c337753150ae9b8921e7f5c4c819ca/scripts/cros_sdk.py

Project Member

Comment 144 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/e801307ece6771b1ce87a91b0af83dd30dc63df7

commit e801307ece6771b1ce87a91b0af83dd30dc63df7
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:15 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139854
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/e801307ece6771b1ce87a91b0af83dd30dc63df7/scripts/cros_sdk.py

Project Member

Comment 145 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-falco_peppy-4389.81.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/ff5217590c06886a570d22da60a2cc89eced3aaf

commit ff5217590c06886a570d22da60a2cc89eced3aaf
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:15 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139855
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ff5217590c06886a570d22da60a2cc89eced3aaf/scripts/cros_sdk.py

Project Member

Comment 146 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/97e779e8032fd4f4c3d7a6a88e2ce80fe141c506

commit 97e779e8032fd4f4c3d7a6a88e2ce80fe141c506
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:16 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139856
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/97e779e8032fd4f4c3d7a6a88e2ce80fe141c506/scripts/cros_sdk.py

Project Member

Comment 147 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-leon-4389.61.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/bc60ea2b5db6ca9ea38d238282f7c5322c4288ba

commit bc60ea2b5db6ca9ea38d238282f7c5322c4288ba
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:17 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139857
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/bc60ea2b5db6ca9ea38d238282f7c5322c4288ba/scripts/cros_sdk.py

Project Member

Comment 148 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/d82b2997397f8ea934c36d061a44bdba8ecb6dcd

commit d82b2997397f8ea934c36d061a44bdba8ecb6dcd
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:17 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139858
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/d82b2997397f8ea934c36d061a44bdba8ecb6dcd/scripts/cros_sdk.py

Project Member

Comment 149 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-leon-4389.26.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/421f7a00171324fbc61ce25574b2cd1c397e3dce

commit 421f7a00171324fbc61ce25574b2cd1c397e3dce
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:18 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139859
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/421f7a00171324fbc61ce25574b2cd1c397e3dce/scripts/cros_sdk.py

Project Member

Comment 150 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/b4ec74a2cde0a56497848381d25c4d34db113879

commit b4ec74a2cde0a56497848381d25c4d34db113879
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:19 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139860
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/b4ec74a2cde0a56497848381d25c4d34db113879/scripts/cros_sdk.py

Project Member

Comment 151 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-wolf-4389.24.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/9ac5774e59977006dac19b2b6060275095d71956

commit 9ac5774e59977006dac19b2b6060275095d71956
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:19 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139861
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/9ac5774e59977006dac19b2b6060275095d71956/scripts/cros_sdk.py

Project Member

Comment 152 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/12f18c4cccc75e191adb3e17167263ce8fdec328

commit 12f18c4cccc75e191adb3e17167263ce8fdec328
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:19:20 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139862
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/12f18c4cccc75e191adb3e17167263ce8fdec328/scripts/cros_sdk.py

Project Member

Comment 153 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-falco_peppy-4389.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/ff538bb042419eda1c2eb1864cc456e3aca32ef5

commit ff538bb042419eda1c2eb1864cc456e3aca32ef5
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:52 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139863
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/ff538bb042419eda1c2eb1864cc456e3aca32ef5/scripts/cros_sdk.py

Project Member

Comment 154 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/55211b621ea544c67e0f8628e1b4c759a522c3f3

commit 55211b621ea544c67e0f8628e1b4c759a522c3f3
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:52 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139864
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/55211b621ea544c67e0f8628e1b4c759a522c3f3/scripts/cros_sdk.py

Project Member

Comment 155 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-pit-4280.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/98ce9db6884e1901ffe7232e4dbd82a93cad965d

commit 98ce9db6884e1901ffe7232e4dbd82a93cad965d
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:53 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139865
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/98ce9db6884e1901ffe7232e4dbd82a93cad965d/scripts/cros_sdk.py

Project Member

Comment 156 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/2b1ca3e00956ed9cf3fbbcee177e9be33befc8ed

commit 2b1ca3e00956ed9cf3fbbcee177e9be33befc8ed
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:54 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139866
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/2b1ca3e00956ed9cf3fbbcee177e9be33befc8ed/scripts/cros_sdk.py

Project Member

Comment 157 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-skate-4262.459.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/a92ce6be1b7a2b30ac6761d368385b8e26102124

commit a92ce6be1b7a2b30ac6761d368385b8e26102124
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:54 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139867
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/a92ce6be1b7a2b30ac6761d368385b8e26102124/scripts/cros_sdk.py

Project Member

Comment 158 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/e65603af838332397be12ea588b9f88455dc5673

commit e65603af838332397be12ea588b9f88455dc5673
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:55 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139868
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/e65603af838332397be12ea588b9f88455dc5673/scripts/cros_sdk.py

Project Member

Comment 159 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-spring-4262.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/0b182c5a029b3447ae3ed2097a973a756e27f6a4

commit 0b182c5a029b3447ae3ed2097a973a756e27f6a4
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:56 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139869
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/0b182c5a029b3447ae3ed2097a973a756e27f6a4/scripts/cros_sdk.py

Project Member

Comment 160 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/69b01618f8235a718e6406a1e4bab9edb078cde7

commit 69b01618f8235a718e6406a1e4bab9edb078cde7
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:56 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139870
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/69b01618f8235a718e6406a1e4bab9edb078cde7/scripts/cros_sdk.py

Project Member

Comment 161 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-spring-4131.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/8315b450db9992f1c652d678fe36db7f7b7c3e6a

commit 8315b450db9992f1c652d678fe36db7f7b7c3e6a
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:57 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139871
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/8315b450db9992f1c652d678fe36db7f7b7c3e6a/scripts/cros_sdk.py

Project Member

Comment 162 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/1e8020383693e46db76ca4143e2dab57de63fa03

commit 1e8020383693e46db76ca4143e2dab57de63fa03
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:21:58 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139872
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/1e8020383693e46db76ca4143e2dab57de63fa03/scripts/cros_sdk.py

Project Member

Comment 163 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-factory-spring-3842.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/2bccd4780c8935561a1730dffac7559f9d40b69c

commit 2bccd4780c8935561a1730dffac7559f9d40b69c
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:23 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139873
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/2bccd4780c8935561a1730dffac7559f9d40b69c/scripts/cros_sdk.py

Project Member

Comment 164 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/0c96379660760ccaea4ae89b4ec5d77a0877ab1f

commit 0c96379660760ccaea4ae89b4ec5d77a0877ab1f
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:24 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139874
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/0c96379660760ccaea4ae89b4ec5d77a0877ab1f/scripts/cros_sdk.py

Project Member

Comment 165 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-spring-3833.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/b9bf85d0a03f28d9c1385eab61325c7d1a918fec

commit b9bf85d0a03f28d9c1385eab61325c7d1a918fec
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:24 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139875
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/b9bf85d0a03f28d9c1385eab61325c7d1a918fec/scripts/cros_sdk.py

Project Member

Comment 166 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/9efe00cf38a793d4b6e560b7400e915a8305420d

commit 9efe00cf38a793d4b6e560b7400e915a8305420d
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:25 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139876
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/9efe00cf38a793d4b6e560b7400e915a8305420d/scripts/cros_sdk.py

Project Member

Comment 167 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-spring-3824.84.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/9a0a7533e86887d7fbd930e530440d6e908202b5

commit 9a0a7533e86887d7fbd930e530440d6e908202b5
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:26 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139877
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/9a0a7533e86887d7fbd930e530440d6e908202b5/scripts/cros_sdk.py

Project Member

Comment 168 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/79a402cd819280419e0b7800fd5ee54976f4d844

commit 79a402cd819280419e0b7800fd5ee54976f4d844
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:27 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139878
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/79a402cd819280419e0b7800fd5ee54976f4d844/scripts/cros_sdk.py

Project Member

Comment 169 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-spring-3824.55.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/5bdea5dbb2aebc4c2f0a1eab88c1f9d7e252067d

commit 5bdea5dbb2aebc4c2f0a1eab88c1f9d7e252067d
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:27 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139879
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/5bdea5dbb2aebc4c2f0a1eab88c1f9d7e252067d/scripts/cros_sdk.py

Project Member

Comment 170 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/5b63fdb6047752bba9e00e780b6f81a35c1bb665

commit 5b63fdb6047752bba9e00e780b6f81a35c1bb665
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:28 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139880
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/5b63fdb6047752bba9e00e780b6f81a35c1bb665/scripts/cros_sdk.py

Project Member

Comment 171 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-spring-3824.4.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/59a777e9658833d1136ac0fe7ae556c4ef0b6054

commit 59a777e9658833d1136ac0fe7ae556c4ef0b6054
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:29 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139881
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/59a777e9658833d1136ac0fe7ae556c4ef0b6054/scripts/cros_sdk.py

Project Member

Comment 172 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/0f189afc029daf5161b4be057b4e1bfffec60a1d

commit 0f189afc029daf5161b4be057b4e1bfffec60a1d
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:29 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139882
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/0f189afc029daf5161b4be057b4e1bfffec60a1d/scripts/cros_sdk.py

Project Member

Comment 173 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-skate-3824.129.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/560f0420f68b7e0f4bcd1b5ae5e3ff39ed21c37b

commit 560f0420f68b7e0f4bcd1b5ae5e3ff39ed21c37b
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:30 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139883
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/560f0420f68b7e0f4bcd1b5ae5e3ff39ed21c37b/scripts/cros_sdk.py

Project Member

Comment 174 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/f9749114f4b96f9cbe48734e3b2b197902b548ae

commit f9749114f4b96f9cbe48734e3b2b197902b548ae
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:31 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139884
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/f9749114f4b96f9cbe48734e3b2b197902b548ae/scripts/cros_sdk.py

Project Member

Comment 175 by bugdroid1@chromium.org, Jul 17

Labels: merge-merged-firmware-spring-3824.B
The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/b8ded61f12185c33de05879968706b2af67639a2

commit b8ded61f12185c33de05879968706b2af67639a2
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:32 2018

cros_sdk: improve curl output parsing

Derived from CoreOS commit add4c2e24ca7e23bb3895fdea8fa58eab950f9dc
https://github.com/coreos/chromite/pull/21

    """
    Blindly searching for '200 OK' doesn't work with HTTP/2 which doesn't
    include a text description in the response. Match the status line by
    prefix instead. Seems less foolish anyway.
    """

Might as well future-proof against HTTP revisions up to 9.9 ;)

BUG=chromium:541462, chromium:810207
TEST=`cros_sdk`; set up new chroot; trybots

Cherry picked from master. Conflicts:
* Removed call to logging

Change-Id: I5e88a4b38f357bb08449de302a5c813f572136d2
Inspired-by: Michael Marineau <michael.marineau@coreos.com>
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/373685
Tested-by: Harry Pan <gs0622@gmail.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Signed-off-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957712
Reviewed-on: https://chromium-review.googlesource.com/1139885
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/b8ded61f12185c33de05879968706b2af67639a2/scripts/cros_sdk.py

Project Member

Comment 176 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/chromite/+/78d6bec76e627f65adfd6c44da6b8373168acdd1

commit 78d6bec76e627f65adfd6c44da6b8373168acdd1
Author: Brian Norris <briannorris@chromium.org>
Date: Tue Jul 17 03:23:32 2018

cros_sdk: fix more quirks and corner cases in parsing curl HTTP responses

See section 3.1 here:

https://www.ietf.org/rfc/rfc2616.txt

that says:

"""
   The version of an HTTP message is indicated by an HTTP-Version field
   in the first line of the message.

       HTTP-Version   = "HTTP" "/" 1*DIGIT "." 1*DIGIT
"""

However, we've seen reports in the wild of (potentially non-conforming?)
HTTP/2 implementations returning 'HTTP/2 200 OK'. Rather than being
unnecessarily pedantic here, let's just accept the not-so-standard
format.

While we're at it, I noticed that the HTTP standard allows for these
major/minor revisions to roll over to 2+ digits.

And finally, note that '.' is a regex wildcard. Let's escape it
properly.

So, a few representative examples of prefixes we accept:

  'HTTP/1.0 200'
  'HTTP/1.1 200'
  'HTTP/1 200'
  'HTTP/2.0 200'
  'HTTP/2 200'
  'HTTP/99999 200'
  'HTTP/1337.987654321 200'

But we no longer allow:

  'HTTP/1a0 200'

BUG=chromium:541462, chromium:810207
TEST=trybots; download a new checkout / build the cros_sdk chroot

Change-Id: I804a0bd13f50ddaec1f6a6b7fe0fd16f5aa9167d
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/389815
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/957714
Commit-Queue: Alexandru M Stan <amstan@chromium.org>
Tested-by: Alexandru M Stan <amstan@chromium.org>
Trybot-Ready: Alexandru M Stan <amstan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1139886
Tested-by: Mike Frysinger <vapier@chromium.org>

[modify] https://crrev.com/78d6bec76e627f65adfd6c44da6b8373168acdd1/scripts/cros_sdk.py

Showing comments 77 - 176 of 176 Older

Sign in to add a comment