-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http, url: Bring back chromium_url and http_parser_parse_url (#198)
* Revert GURL as HTTP URL parser utility This reverts: 1. commit c9c4709 2. commit d828958 3. commit 2d69e30 Signed-off-by: Dhi Aurrahman <dio@tetrate.io>
- Loading branch information
1 parent
2c60632
commit 3b5acb2
Showing
40 changed files
with
1,490 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
load( | ||
"//bazel:envoy_build_system.bzl", | ||
"envoy_cc_library", | ||
"envoy_package", | ||
) | ||
|
||
licenses(["notice"]) # Apache 2 | ||
|
||
envoy_package() | ||
|
||
envoy_cc_library( | ||
name = "chromium_url", | ||
srcs = [ | ||
"url_canon.cc", | ||
"url_canon_internal.cc", | ||
"url_canon_path.cc", | ||
"url_canon_stdstring.cc", | ||
], | ||
hdrs = [ | ||
"envoy_shim.h", | ||
"url_canon.h", | ||
"url_canon_internal.h", | ||
"url_canon_stdstring.h", | ||
"url_parse.h", | ||
"url_parse_internal.h", | ||
], | ||
deps = ["//source/common/common:assert_lib"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2015 The Chromium Authors. All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are | ||
// met: | ||
// | ||
// * Redistributions of source code must retain the above copyright | ||
// notice, this list of conditions and the following disclaimer. | ||
// * Redistributions in binary form must reproduce the above | ||
// copyright notice, this list of conditions and the following disclaimer | ||
// in the documentation and/or other materials provided with the | ||
// distribution. | ||
// * Neither the name of Google Inc. nor the names of its | ||
// contributors may be used to endorse or promote products derived from | ||
// this software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
This is a manually minified variant of | ||
https://chromium.googlesource.com/chromium/src.git/+archive/74.0.3729.15/url.tar.gz, | ||
providing just the parts needed for `url::CanonicalizePath()`. This is intended | ||
to support a security release fix for CVE-2019-9901. Long term we need this to | ||
be moved to absl or QUICHE for upgrades and long-term support. | ||
|
||
Some specific transforms of interest: | ||
* The namespace `url` was changed to `chromium_url`. | ||
* `url_parse.h` is minified to just `Component` and flattened back into the URL | ||
directory. It does not contain any non-Chromium authored code any longer and | ||
so does not have a separate LICENSE. | ||
* `envoy_shim.h` adapts various macros to the Envoy context. | ||
* Anything not reachable from `url::CanonicalizePath()` has been dropped. | ||
* Header include paths have changed as needed. | ||
* BUILD was manually written. | ||
* Various clang-tidy and format fixes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include "common/common/assert.h" | ||
|
||
// This is a minimal Envoy adaptation layer for the Chromium URL library. | ||
// NOLINT(namespace-envoy) | ||
|
||
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ | ||
TypeName(const TypeName&) = delete; \ | ||
TypeName& operator=(const TypeName&) = delete | ||
|
||
#define EXPORT_TEMPLATE_DECLARE(x) | ||
#define EXPORT_TEMPLATE_DEFINE(x) | ||
#define COMPONENT_EXPORT(x) | ||
|
||
#define DCHECK(x) ASSERT(x) | ||
#define NOTREACHED() NOT_REACHED_GCOVR_EXCL_LINE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Envoy snapshot of Chromium URL path normalization, see README.md. | ||
// NOLINT(namespace-envoy) | ||
|
||
// Copyright 2017 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "common/chromium_url/url_canon.h" | ||
|
||
#include "common/chromium_url/envoy_shim.h" | ||
|
||
namespace chromium_url { | ||
|
||
template class EXPORT_TEMPLATE_DEFINE(COMPONENT_EXPORT(URL)) CanonOutputT<char>; | ||
|
||
} // namespace chromium_url |
Oops, something went wrong.