Code Monkey home page Code Monkey logo

Comments (6)

dterhorst-zz avatar dterhorst-zz commented on September 23, 2024

I worked around this locally with the following changes in lib/fakes3/file_store.rb:

86c86
<         real_obj.modified_date = metadata.fetch(:modified_date) { File.mtime(File.join(obj_root,"content")).iso8601() }
---
>         real_obj.modified_date = metadata.fetch(:modified_date) { File.mtime(File.join(obj_root,"content")).utc.iso8601() }
166c166
<         metadata_struct[:modified_date] = File.mtime(content).iso8601()
---
>         metadata_struct[:modified_date] = File.mtime(content).utc.iso8601()

from fake-s3.

 avatar commented on September 23, 2024

@dterhorst

Great job!

from fake-s3.

michael-customlbs avatar michael-customlbs commented on September 23, 2024

I have the problem that I always get a ISO8601 formatted date, but sometimes the AWS Java SDK required a RFC822 formatted date:
https://github.com/aws/aws-sdk-java/blob/4a67bca8f1c6d5cf80a112f82d5d3a3967ebcdaf/src/main/java/com/amazonaws/services/s3/internal/AbstractS3ResponseHandler.java#L115

But usually ISO8601 is needed:
https://github.com/aws/aws-sdk-java/blob/4a67bca8f1c6d5cf80a112f82d5d3a3967ebcdaf/src/main/java/com/amazonaws/services/s3/model/transform/XmlResponsesSaxParser.java#L596

Can anyone explain to me what might be wrong here?

from fake-s3.

jbyler avatar jbyler commented on September 23, 2024

Dates which are HTTP header values need to follow RFC 822 as modified by RFC 1123 (spec). Dates which are XML DateTimes need to follow the XML format, which is "inspired by ISO 8601" (spec).

from fake-s3.

michael-customlbs avatar michael-customlbs commented on September 23, 2024

So, is fakes3 following that rule?

from fake-s3.

jbyler avatar jbyler commented on September 23, 2024

I believe that as of commit 3e2f69e fake-s3 is formatting the Last-Modified HTTP header correctly. Note that as of this writing, the latest release is v0.1.5.2 which does not contain the fix, so to get properly formatted Last-Modified header you have to check out from master.

I haven't verified the XML formatting done by fake-s3.

from fake-s3.

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.