Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Storage] full url should be used in BatchRequest multi-part API #7535

Closed
jeremymeng opened this issue Feb 25, 2020 · 5 comments
Closed

[Storage] full url should be used in BatchRequest multi-part API #7535

jeremymeng opened this issue Feb 25, 2020 · 5 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)

Comments

@jeremymeng
Copy link
Member

There's a customer reported issue for python where token credential would fail to work with batch request that doesn't have full url.

Azure/azure-sdk-for-python#9534

I believe we have same issue as we only use the path and query

    this.body += [
      this.subRequestPrefix, // sub request constant prefix
      `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID
      "", // empty line after sub request's content ID
      `${request.method.toString()} ${getURLPathAndQuery(
        request.url
      )} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` // sub request start line with method
    ].join(HTTP_LINE_ENDING);
@jeremymeng jeremymeng added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Feb 25, 2020
@ljian3377
Copy link
Member

ljian3377 commented Mar 5, 2020

Are you suggesting use request.url directly instead of getURLPathAndQuery( request.url).

    this.body += [
      this.subRequestPrefix, // sub request constant prefix
      `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID
      "", // empty line after sub request's content ID
      `${request.method.toString()} ${request.url} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` // sub request start line with method
    ].join(HTTP_LINE_ENDING);

@jeremymeng
Copy link
Member Author

Yes

@voidfoo
Copy link

voidfoo commented Mar 7, 2020

Although we might not have a bug because we might not have the credential similar to what python has (beakTokenCredentialPolicy in the linked issue)

@ljian3377 ljian3377 added this to the Backlog milestone Aug 17, 2020
@ljian3377 ljian3377 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Sep 10, 2020
@ljian3377 ljian3377 modified the milestones: Backlog, [2020] November Oct 21, 2020
@ljian3377
Copy link
Member

ljian3377 commented Oct 31, 2020

We do have the same issue. Reproduced in #12212
But I am not sure if using full url is the right fix.

Updates:
Actually the repro in 097a676 was due to another issue #12219.

@ljian3377
Copy link
Member

We don't have the same issue. According to the REST API doc: https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch

  • The subrequest URL should only have the path of the URL (i.e without the host).
  • Each subrequest will be authorized and authorized separately with the provided information in the subrequest.

And we are correctly assembling the sub requests. For example, in this test case, 4a80d44

--batch_e4a717e2-8ebf-43ea-a609-115d833ca9b9
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 0

DELETE /container160429459257406184/blob0 HTTP/1.1
authorization: Bearer eyJ...

--batch_e4a717e2-8ebf-43ea-a609-115d833ca9b9
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 1

DELETE /container160429459257406184/blob1 HTTP/1.1
authorization: Bearer eyJ...

--batch_e4a717e2-8ebf-43ea-a609-115d833ca9b9
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: 2

DELETE /container160429459257406184/%C3%A5%20%C3%A4%20%C3%B6 HTTP/1.1
authorization: Bearer eyJ...

--batch_e4a717e2-8ebf-43ea-a609-115d833ca9b9--

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

5 participants