question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cors exception + Readme CopyPaste bug

See original GitHub issue
CorsMiddleware.configure({})` 

This throws unhandled promise rejection exception.

Passing null instead seems to do the trick

CorsMiddleware.configure(null)` 

Also the Readme in CorsMiddleware uses HelmetMiddleware instead of CorsMiddleware. I assume this is a minor bug.

Is the MiddlewaresConsumer any different that MiddlewareConsumer (without s). Cause I couldnt find such class.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wbhobcommented, Sep 30, 2019

published v6.0.1

0reactions
kctangcommented, Sep 26, 2019

Hi @wbhob & @anodynos ,

Took me two hours to realise this - I think the fix from #20 is not released in v6.0.0. https://github.com/wbhob/nest-middlewares/blob/v6.0.0/packages/cors/index.ts.

cors() is called without else.

With the fix, custom CORS options will work (i tested locally by making a copy of the middleware from master).

Hope you can release a new version soon so I don’t have to dup a local copy of the CORS middleware.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debugging CORS problems for End-Users
CORS issues happen when the browser does not trust the endpoint that it is trying to reach. In order to allow calls from...
Read more >
3 Ways to Fix the CORS Error — and How the Access- ...
Fix one: install the Allow-Control-Allow-Origin plugin. The quickest fix you can make is to install the moesif CORS extension .
Read more >
Cannot copy-paste a container with a custom layout manager
I get following exceptions (printed in console): java.lang.InstantiationException: org.netbeans.modules.form.layoutsupport.DefaultLayoutSupport ...
Read more >
How to enable cross-origin requests in Grails websocket ...
Grails-cors plugin is not working for grails 3.x, but there is some info in the repo readme. I'll copy/paste it here:.
Read more >
tkrotoff/fetch
... to manually throw an exception on HTTP error status (like 404 or 500) ... npm install @tkrotoff/fetch ... Or copy-paste Http.ts into...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found