Comments (2)
I really dislike problems that are multi-library problems. There are two things in play here:
-
ServerRequestCreator::createUploadedFileFromSpec
returns an instance (or (nested) array) of PSR-7UploadedFileInterface
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-7StreamInterface
. The code as it is currently assumes thatStreamFactoryInterface::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. -
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.
@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)
- Version 1.0? HOT 6
- Should fromGlobals also set the HTTP request body? HOT 1
- Stop using UriFactory HOT 3
- Static method in interface? HOT 2
- Duplicated port in URI HOT 3
- Incorrect scheme/port when using a proxy-server HOT 15
- Better Namespaces HOT 3
- Fix tests fixtures
- Header with only numbers seems to cause exception HOT 23
- Empty file upload gives fatal error in PHP 8.0 HOT 1
- Filter headers consisting only of whitespace before creating a ServerRequest HOT 2
- Duplicate host values in Host header when creating a Psr request from globals
- Uri::withPort + numeric strings
- Scheme detection problem
- psr/http-message version issue HOT 4
- Hope support php8.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from psr7-server.