Comments (4)
After looking into this issue, I was not able to produce any exceptions.
Have you captured some of these requests?
I did however find that Omejdn does tend to behave very strange with regards to some OPTIONS
requests.
For me, when trying to find OPTIONS for (say) /api/v1/config/
, I get a 403 Error when I would expect to see a valid response.
While I can confirm that your idea would fix the issue for now, it is likely to reoccur whenever someone decides to write a new before
filter.
An alternative fix would be to handle OPTIONS
in the global before
filter like this:
if request.env['REQUEST_METHOD'] == 'OPTIONS'
options = (['OPTIONS','HEAD','GET','POST','PUT','DELETE'].select do |verb|
!settings.routes[verb].select{|r,c,b| request.path_info == '*' || r === request.path_info}.empty?
end)
halt 404 if options.empty?
headers['Allow'] = options.join(',')
headers['Content-Type'] ||= 'text/html'
halt 200, options.join(',')
end
This is not without limitations either, since after
filters can still apply and overwrite the content type, but probably less likely to occur and simple to fix by replacing e.g.
headers['Content-Type'] = 'application/json'
with
headers['Content-Type'] ||= 'application/json'
from omejdn-server.
This is a "bug" in sinatra/cors which handles CORS requests (OPTION requests) automatically.
It hooks itself into the "before" pipeline as well, it is unclear to me at which point it is executed.
Maybe at some point we want to simply replace it with our own handler.
In particular, the CORS settings (ALLOW_*) are currently applied to all endpoints, which does not really make sense anyway.
from omejdn-server.
I think this was fixed in #23?
from omejdn-server.
It should work for now, but we should revisit this in the future. You can close this issue if you like
from omejdn-server.
Related Issues (20)
- Separate User selection from authentication HOT 3
- Simpler Certificate File Names HOT 1
- Certificate Bound Access Tokens HOT 4
- Misleading documentation HOT 1
- Outputs are cached instead of written to stdout on Docker HOT 1
- Client Certificate Revocation Checks
- Warn or refuse to import invalid certificates HOT 2
- How to request an access token? HOT 4
- Respect `response_mode` in error responses
- Sanitize scopes in Session
- Show requested Claims to User
- Rethink Logouts HOT 1
- DAPS capability of holding one attribute HOT 5
- Logout URL formatting issue
- Bug in KEYS_LOAD_ALL event of DefaultKeysDB HOT 1
- Invalid request: Content longer than specified HOT 4
- Make `scope` optional in token request for `client_credentials` HOT 1
- Features and Specification HOT 2
- JWKS endpoint as a high risk resource of the entire dataspace HOT 1
- The ```resource_owner.attributes``` field used by ```filter_scopes``` is not a ```Hash```
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 omejdn-server.