Comments (1)
Thanks for opening the issue!
As you can follow the thread on Starlet, there are two possible suggestions:
Allow psgix
env var to indicate that the current request is incomplete/broken
Server will (optionally) mark the broken or invalid request with psgix.invalid_request
and such, and send as a regular PSGI env to the application. Application will look at that PSGI environment variable and do whatever it wants to do, such as logging to a special error log, or just throw it away.
Because PSGI specification does not currently have a way for application to server, there needs to be a way for developers to turn on this option, because otherwise PSGI application that are not aware of will be sent such requests and cause unexpected behaviors (as stated in the original issue).
Servers support Error Handlers app
In addition to the regular (main) PSGI application, servers will accept a separate PSGI application handler to handle such errors. This is close to Apache's error handler directive, and actually Plack has its ErrorDocument middleware that accepts such error handlers (although the implementation is a bit rough).
This probably does not need a revision in the PSGI spec itself, but could have a standardized/common way to specify such error handlers across server implementations.
Because you specify two different PSGI applications, developers have a complete control of specifying what to do in the error case, which might be useful if you want to deploy a PSGI application written by third party (such as the one on Github or CPAN).
The downside would be you possibly have to duplicate the middleware stack, both for the main application and error handler application, and if you need to share some resource such as open UNIX socket or file handle, it might be difficult or impossible, depending on what you want to do.
from psgi-specs.
Related Issues (20)
- Document that content body should be bytes not wide chars
- return value of reponse-starter callback passed for streaming is not defined HOT 4
- PSGI file evaluation convention HOT 3
- The section "TERMINOLOGIES > Servers" is more confusing than necessary HOT 1
- Comments to environment cleanup handlers HOT 23
- PSGI should allow the 0th array element to be a full HTTP status line HOT 5
- Comments on return values for PSGI streaming functions HOT 4
- Streaming / Delayed docs should be updated to clarify where $headers is intended to come from
- Multiple HTTP header values HOT 3
- Makefile.PL fails on Perl without "." in @INC
- PSGI extension for interaction with monitoring HOT 2
- Broken links in the environment description
- Clarification with SERVER_PORT HOT 6
- Add psgix.informatonal callback to PSGI::Extensions
- IO::Handle-like $body -- why getline(), not read() HOT 2
- Add REQUEST_URI HOT 1
- Fix poll_cb in FAQ HOT 1
- Document psgix.io
- Document psgix.input.buffered
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 psgi-specs.