Giter Club home page Giter Club logo

Comments (4)

vigneashs avatar vigneashs commented on August 15, 2024 1

from azurite.

vigneashs avatar vigneashs commented on August 15, 2024

Snippet which causes the regression:
if (isSecondary) {
const pos = blobContext.authenticationPath.search(SECONDARY_SUFFIX);
blobContext.authenticationPath =
blobContext.authenticationPath.substr(0, pos) +
blobContext.authenticationPath.substr(pos + SECONDARY_SUFFIX.length);
}

Now, this works fine for non-production URLs like - 127.0.0.1:10000/devaccount-secondary/testcontainer. As there is a secondary suffix in the authentication path - /devaccount-secondary/testcontainer. So this path gets transformed to /devaccount/testcontainer

Now, let's take a look at production URL trying to access a secondary storage, devaccount-secondary.sample.com/testcontainer.

The authentication path looks like this - /testcontainer.
now, when we search for secondary_suffix, the code would return -1 (non-existence). In the next line, we are doing a substring of (0,-1) and (-1+10) - (9). So, the resulting string would be "ainer". This causes the authentication string to be malformed and results in authentication errors for production style secondary URLs.

from azurite.

blueww avatar blueww commented on August 15, 2024

@vigneashs

Thanks for finding and investigation of this issue!

Azurite welcome contribution!
Would you like to raise a PR to fix this issue?

from azurite.

blueww avatar blueww commented on August 15, 2024

@vigneashs

I have reviewed your PR, and raised a comment for change log and test case.
Would you please help to look?

from azurite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.