Giter VIP home page Giter VIP logo

Comments (2)

Zegnat avatar Zegnat commented on July 23, 2024

I really dislike problems that are multi-library problems. There are two things in play here:

  1. ServerRequestCreator::createUploadedFileFromSpec returns an instance (or (nested) array) of PSR-7 UploadedFileInterface from whichever factory you have provided. These instances include the error code (which is being passed along), so theoretically we shouldn’t have to do any other upload error processing.

    PSR-17 UploadedFileFactoryInterface::createUploadedFile requires a valid PSR-7 StreamInterface. The code as it is currently assumes that StreamFactoryInterface::createStreamFromFile is just always going to work. Which is not a good idea. In case it goes wrong I think we should be creating an empty instance instead.

  2. The factory you are using (is it nyholm/psr7?) doesn’t seem to throw a \RuntimeException when it fails to create the stream instance. (Or it did, but you didn’t see it?) This goes against PSR-17, so the fix I described above wouldn’t solve your issue!

    The factory library you are using will need to change to correctly handle \fopen failures. Which is outside of this package’s control.

from psr7-server.

Zegnat avatar Zegnat commented on July 23, 2024

@emonkak I would appreciate it if you could have a look at my PR and let me know if this solves the issue for you: #21.

from psr7-server.

Related Issues (17)

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.