Comments (2)
@rknLA @npbee I'd love your thoughts here :)
from pale.
Yeah, so looking at the _pre_response_handlers
thing, a couple of thoughts come to mind:
- First, assuming this is the right way to solve the problem, I'm not a huge fan of the name, since technically everything is "pre-response". If we wind up keeping the functionality, I would suggest calling it
_after_render_handlers
or_post_render_handlers
or something along those lines, since it's more specific. - Second, is this the right way to solve this problem? I'm all for figuring out how to elegantly keep this if it's clear that it has uses beyond just CORS, but my gut reaction is that it might cause more headaches in a general state -- It confuses some of the structure and process. Adding a step to the execution pipeline outside of the try/except seems like it will better enable people to shoot themselves in the foot, and seems like it enables/encourages monkey-patching beyond what should be necessary. I completely understand why you put it outside of the try/except block, but it still makes me a bit uneasy.
CORS is a pretty specific problem, and imho, probably common enough in HTTP APIs to have CORS-specific functionality, rather than adding more generalization.
from pale.
Related Issues (20)
- Support for JSON serialized body arguments
- Tidy up the JSON request body handling
- Add `Field` and `Argument` types to paledoc
- StringEnumArgument
- Response content_type should be set as appropriate
- ResourceList does not instantiate item_type with a name HOT 1
- Timestamp Field Rendering
- Wrap `uri_for` into context (and/or adaptor)
- Field rendering by passing raw data, not relying on object lookup HOT 1
- Pass the request context to the `RelativeLinks` generators
- `context.args` should populate keys for all arguments, even if the value is None
- test coverage for context.route_kwargs
- Field.render support for `dict` objects
- Method for handling "PUT" requests
- Add RAML output to pale/doc.py
- Add RAML/JSON docs example to example app
- Add optional permissions check for doc.py in generate_json_docs
- Clean descriptions in JSON docs
- Better solution for catching OPTIONS requests
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 pale.