[Storage] Custom domain support.#10771
Merged
jiacfan merged 10 commits intoAzure:masterfrom Aug 25, 2020
Merged
Conversation
Member
|
The const parsedUrl = URLBuilder.parse(this.url);
if (parsedUrl.getHost()!.split(".")[1] === "blob") {
// "https://myaccount.blob.core.windows.net/containername/blob".
// .getPath() -> /containername/blob
const pathComponents = parsedUrl.getPath()!.match("/([^/]*)(/(.*))?");
containerName = pathComponents![1];
blobName = pathComponents![3];
} else if (isIpEndpointStyle(parsedUrl)) {
// IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername/blob
// Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername/blob
// .getPath() -> /devstoreaccount1/containername/blob
const pathComponents = parsedUrl.getPath()!.match("/([^/]*)/([^/]*)(/(.*))?");
containerName = pathComponents![2];
blobName = pathComponents![4];
} else {
// "https://customdomain.com/containername/blob".
// .getPath() -> /containername/blob
const pathComponents = parsedUrl.getPath()!.match("/([^/]*)(/(.*))?");
containerName = pathComponents![1];
blobName = pathComponents![3];
}
``` #WontFix |
Member
Author
|
Not combine by design, actually my first code version before PR is combined version, while I changed back to this splitted version for : 1) Reduce regression risk. 2) For ease of maintaining, other wise first branch will be (parsedUrl.getHost()!.split(".")[1] === "blob") || !isIpEndpointStyle(parsedUrl)), which might be not easy for other maintainers. 3) For extensibility, logically this parse logic could be extended further, so we might split existing else further. In reply to: 678883200 [](ancestors = 678883200) |
ljian3377
reviewed
Aug 25, 2020
ljian3377
approved these changes
Aug 25, 2020
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support custom domain which targets to solve #9896 and #10520 .