Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Makes CSP middleware work in an environment without express server #184

Merged
merged 2 commits into from
May 13, 2019

Conversation

codeworrior
Copy link
Member

With change 4f05967, the CSP middleware
made use of 'express' APIs on the request object. When used in an
environment without 'express' (e.g. the OpenUI5 legacy grunt tooling),
the CSP middleware failed for all requests.

It now uses the native NodeJS APIs again.

Fixes https://github.com/SAP/ui5-server/issues/183 .

Thank you for your contribution! 🙌

To get it merged faster, kindly review the checklist below:

Pull Request Checklist

With change 4f05967, the CSP middleware
made use of 'express' APIs on the request object. When used in an
environment without 'express' (e.g. the OpenUI5 legacy grunt tooling),
the CSP middleware failed for all requests.

It now uses the native NodeJS APIs again.

Fixes https://github.com/SAP/ui5-server/issues/183 .
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 93.208% when pulling 2a36e9d on fix-csp-middleware into bfdbaac on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 93.208% when pulling 2a36e9d on fix-csp-middleware into bfdbaac on master.

@RandomByte RandomByte requested a review from svbender May 11, 2019 13:56
@codeworrior codeworrior merged commit c3089ad into master May 13, 2019
@codeworrior codeworrior deleted the fix-csp-middleware branch May 13, 2019 07:51
matz3 added a commit that referenced this pull request May 24, 2019
This makes all middlewares independent of the express specific
`req.path` property by manually parsing the standard `req.url`.

The `parseurl` library is also used within express and makes sure to
not parse the same URL of a request object again by using a cache on
the request object.

Follow up of #184

Fixes: SAP/karma-ui5#64
matz3 added a commit that referenced this pull request May 27, 2019
This makes all middlewares independent of the express specific
`req.path` property by manually parsing the standard `req.url`.

The `parseurl` library is also used within express and makes sure to
not parse the same URL of a request object again by using a cache on
the request object.

Follow up of #184

Fixes: SAP/karma-ui5#64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenUI5's legacy tooling breaks when linking to @ui5/server 1.1.0
3 participants