Code Monkey home page Code Monkey logo

Comments (13)

PavelSafronov avatar PavelSafronov commented on June 24, 2024

What are the problematic file names?

from aws-sdk-net.

lestevam avatar lestevam commented on June 24, 2024

The example below is not found without URLEncoded
"Systems/20/1161/185_185_CF NEUSA GOMES FERREIRA.DOC"

But the following example is not found if the URL is with URLEncoded
"Systems/20/1161/184_184_RE SOLICITAÇÕES - 31 07 - CF.MSG"

from aws-sdk-net.

PavelSafronov avatar PavelSafronov commented on June 24, 2024

Have you tried these paths with the most recent versions of the SDK?

from aws-sdk-net.

lestevam avatar lestevam commented on June 24, 2024

Pavel, I'm using the latest version I believe (2.0.0.2). There is a larger version of this? Tks

from aws-sdk-net.

PavelSafronov avatar PavelSafronov commented on June 24, 2024

The latest version is 2.0.2 (and 1.5.39 if using the v1 SDK).

from aws-sdk-net.

lestevam avatar lestevam commented on June 24, 2024

Pavel, I discovered what was happening, in fact, when it includes the "URLEncoded" to set in the "key" of the request object, looking at the object seemed to be all right, but internally, more precisely between lines 98 and 113 of the class "S3Signer.cs "was launched again" URLEncode ", generating an encoding upon a URL already coded.

As said before, I still had other problems, but when running the procedure again, the URLs were eventually found. I'm performing further tests to see if some other error occurs.

From what I understand the method "URLEncode" should not be used directly because the URLs are already coded internally.

Anyway thank you and sorry for posting.

from aws-sdk-net.

PavelSafronov avatar PavelSafronov commented on June 24, 2024

You're correct, strings that are passed into the SDK should generally not be URLEncode-d unless specifically called out.

Can you expand a bit on what "other problems" had caused the URLs to not come back? I'm curious if other users may face a similar issue.

from aws-sdk-net.

lestevam avatar lestevam commented on June 24, 2024

I was having problems with some URLs, but so far have not gotten over the mistake.

Performed tests on 5k records, and all were successful. Tonight put into production, and the number has increased to 7m of records, should take a few days to carry out the whole process, then I know exactly whether or not there is a problem with some URL.

When finished, I'll come back and post the result.

from aws-sdk-net.

lestevam avatar lestevam commented on June 24, 2024

Pavel, I made some more tests and found the following problem:

If you have a file with Url that contains the character "!" (Exclamation), the status code returned in the response is "Forbiden" and not "Found" or "NotFound". If I remove the character "!" then it returns me "Found" or "NotFound". I believe that if I am seeking a Metadata and address of the file does not exist the answer should be "NotFound".

I followed all the assembly request to see what might be happening, one of the things I found is that the Url will only coded for the metric (HEADER), but the Url that is included in the request, despite also suffering the urlencoded just not entering encoded.

I'll try to explain what I found:

Between line 264 and 267 in class "AbstractServiceClient.cs" to write to the variable "newPath" with UrlEncode, but to write to variable "url" which is an instance of URI, the builder removes the encoded URI. In the next block (between lines 272 and 284), the variable "url" ends up being overwritten, erasing the information already recorded.

Not sure what the problem I have with the character "!" is for the reason mentioned above, but apparently the problem is because the request is not encrypted and for some reason Amazon does not accept the Url with this character, this could happen? Would not it be interesting to send the Url also encoded in the request?

from aws-sdk-net.

PavelSafronov avatar PavelSafronov commented on June 24, 2024

Sorry, I've tried to boil this down to the simplest case in the below code and still was not able to get an error:

client.PutObject(new PutObjectRequest
{
    Key = "Test!.txt",
    ContentBody = "Sample content",
    BucketName = bucketName
});
client.GetObjectMetadata(new GetObjectMetadataRequest
{
    Key = "Test!.txt",
    BucketName = bucketName
});

Can you try to reproduce this issue with a similar test case?

from aws-sdk-net.

lestevam avatar lestevam commented on June 24, 2024

Pavel really your example set no error occurred, but using your code realized changing the file name and then errors are shown again. See below:

client.PutObject(new PutObjectRequest
{
    Key = "Test/Folder1/185211/4_4_4_4_4_ENC URGENTE!!  SOLICITAÇÕES - 2008 - CN.txt",
    ContentBody = "Sample content",
    BucketName = bucketName
});
client.GetObjectMetadata(new GetObjectMetadataRequest
{
    Key = "Test/Folder1/185211/4_4_4_4_4_ENC URGENTE!!  SOLICITAÇÕES - 2008 - CN.txt",
    BucketName = bucketName
});

from aws-sdk-net.

PavelSafronov avatar PavelSafronov commented on June 24, 2024

Thanks, this case does reproduce for me. We're looking into this.

from aws-sdk-net.

PavelSafronov avatar PavelSafronov commented on June 24, 2024

The latest version of the SDK (version 2.0.2.3) is patched to resolve this issue.

from aws-sdk-net.

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.