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 CORS bug #88

Conversation

winor30
Copy link
Contributor

@winor30 winor30 commented Nov 8, 2020

Problem

I found the following CORS error in the daf/examples/react-app sample code.

The cause was the presence of Access-Control-Allow-Origin in the request header.
Access-Control-Allow-Origin is not required in the request header as it is a header that should be in the response header to allow CORS.

Solution

  • Changed from Access-Control-Allow-Origin to mode: cors for fetch’s option.
  • Added a sample react application for validation

@winor30 winor30 changed the title Fix cors bug Fix CORS bug Nov 8, 2020
@codecov
Copy link

codecov bot commented Nov 8, 2020

Codecov Report

Merging #88 (b813908) into master (90f73b1) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #88   +/-   ##
=======================================
  Coverage   95.45%   95.45%           
=======================================
  Files           1        1           
  Lines          22       22           
  Branches        6        6           
=======================================
  Hits           21       21           
  Misses          1        1           
Impacted Files Coverage Δ
src/resolver.ts 95.45% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90f73b1...b813908. Read the comment docs.

Copy link
Member

@mirceanis mirceanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks

@mirceanis mirceanis merged commit 2a5b5d1 into decentralized-identity:master Nov 9, 2020
uport-automation-bot pushed a commit that referenced this pull request Nov 9, 2020
## [1.3.4](1.3.3...1.3.4) (2020-11-09)

### Bug Fixes

* CORS bug ([#88](#88)) ([2a5b5d1](2a5b5d1))
@uport-automation-bot
Copy link
Collaborator

🎉 This PR is included in version 1.3.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@uport-automation-bot uport-automation-bot added the triage This issue is currently being examined label Nov 9, 2020
@winor30 winor30 deleted the fix/remove-improper-allow-origin-req-headers branch November 9, 2020 16:46
veramo-bot pushed a commit to veramolabs/plc-did-resolver that referenced this pull request Apr 26, 2023
# 1.0.0 (2023-04-26)

### Bug Fixes

* **build:** publish types in package.json ([174afe8](174afe8))
* CORS bug ([decentralized-identity#88](https://github.com/veramolabs/plc-did-resolver/issues/88)) ([2a5b5d1](2a5b5d1))
* **deps:** bump did-resolver to 3.1.0 ([08358ec](08358ec))
* **deps:** bump did-resolver to 3.1.3 ([f62af45](f62af45))
* **deps:** groom the build scripts and dependencies ([decentralized-identity#120](https://github.com/veramolabs/plc-did-resolver/issues/120)) ([757f6ec](757f6ec))
* **deps:** pin dependencies ([decentralized-identity#89](https://github.com/veramolabs/plc-did-resolver/issues/89)) ([926eb1f](926eb1f))
* **deps:** update all non-major dependencies ([decentralized-identity#93](https://github.com/veramolabs/plc-did-resolver/issues/93)) ([13d8f18](13d8f18))
* **deps:** update all non-major dependencies to v17.0.2 ([0e9e2f0](0e9e2f0))
* **deps:** update all non-major dependencies to v18.1.0 ([cd3ed19](cd3ed19))
* **deps:** update all non-major dependencies to v18.2.0 ([cd99aa3](cd99aa3))
* **deps:** update dependencies, remove ts-jest ([789ec69](789ec69))
* **deps:** update dependency did-resolver to v1.1.0 ([decentralized-identity#39](https://github.com/veramolabs/plc-did-resolver/issues/39)) ([4ade39d](4ade39d))
* **deps:** update dependency did-resolver to v2 ([decentralized-identity#56](https://github.com/veramolabs/plc-did-resolver/issues/56)) ([b420866](b420866))
* **deps:** update dependency did-resolver to v2.1.1 ([decentralized-identity#70](https://github.com/veramolabs/plc-did-resolver/issues/70)) ([0a0f902](0a0f902))
* **deps:** update dependency did-resolver to v3 ([decentralized-identity#94](https://github.com/veramolabs/plc-did-resolver/issues/94)) ([18d1a1d](18d1a1d))
* **deps:** Update dependency did-resolver to v3.1.1 ([91cc1c6](91cc1c6))
* **deps:** Update dependency did-resolver to v3.1.2 ([7902b3f](7902b3f))
* **deps:** Update dependency did-resolver to v3.1.3 ([d77839f](d77839f))
* **deps:** Update dependency did-resolver to v3.1.4 ([02d4c7d](02d4c7d))
* **deps:** Update dependency did-resolver to v3.1.5 ([0728ffb](0728ffb))
* **deps:** Update dependency did-resolver to v3.2.0 ([d33f51e](d33f51e))
* **deps:** Update dependency did-resolver to v3.2.2 ([f494fbe](f494fbe))
* **deps:** Update dependency did-resolver to v4 ([74b825f](74b825f))
* **deps:** Update dependency did-resolver to v4.0.1 ([63d7fc2](63d7fc2))
* **deps:** Update dependency did-resolver to v4.1.0 ([81fa649](81fa649))
* **deps:** update dependency react-scripts to v5 ([bbc4b35](bbc4b35))
* **deps:** update dependency react-scripts to v5.0.1 ([36d0e22](36d0e22))
* **deps:** update react monorepo to v18 ([8f21c88](8f21c88))
* remove checks for a [@context](https://github.com/context) field ([b814b6c](b814b6c)), closes [decentralized-identity#26](https://github.com/veramolabs/plc-did-resolver/issues/26)

### Features

* forked web-did-resolver and refactored to be plc-did-resolver ([7fdeefe](7fdeefe))
* remove default export ([3952bef](3952bef))
* remove default export ([9ef0b37](9ef0b37))
* support for path in the did ([904d88c](904d88c)), closes [decentralized-identity#32](https://github.com/veramolabs/plc-did-resolver/issues/32) [decentralized-identity#33](https://github.com/veramolabs/plc-did-resolver/issues/33)
* update to latest did spec ([decentralized-identity#92](https://github.com/veramolabs/plc-did-resolver/issues/92)) ([4779436](4779436)), closes [decentralized-identity#91](https://github.com/veramolabs/plc-did-resolver/issues/91)
* use cross-fetch instead of XMLHttpRequest ([decentralized-identity#15](https://github.com/veramolabs/plc-did-resolver/issues/15)) ([dadf682](dadf682))
* use cross-fetch instead of XMLHttpRequest ([decentralized-identity#15](https://github.com/veramolabs/plc-did-resolver/issues/15)) ([4378c71](4378c71))

### BREAKING CHANGES

* Resolver now returns a `DIDResolutionResult` that wraps a DIDDocument. No errors are thrown, instead returned as `didResolutionMetadata.error/message`
veramo-bot pushed a commit to veramolabs/peer-did-resolver that referenced this pull request Jan 22, 2024
# 1.0.0 (2024-01-22)

### Bug Fixes

* CORS bug ([decentralized-identity#88](https://github.com/veramolabs/peer-did-resolver/issues/88)) ([2a5b5d1](2a5b5d1))
* **deps:** bump @aviarytech/did-peer to 0.0.22 ([#3](#3)) ([3605a4a](3605a4a))
* **deps:** bump did-resolver to 3.1.0 ([08358ec](08358ec))
* **deps:** bump did-resolver to 3.1.3 ([f62af45](f62af45))
* **deps:** groom the build scripts and dependencies ([decentralized-identity#120](https://github.com/veramolabs/peer-did-resolver/issues/120)) ([757f6ec](757f6ec))
* **deps:** pin dependencies ([decentralized-identity#89](https://github.com/veramolabs/peer-did-resolver/issues/89)) ([926eb1f](926eb1f))
* **deps:** update all non-major dependencies ([decentralized-identity#93](https://github.com/veramolabs/peer-did-resolver/issues/93)) ([13d8f18](13d8f18))
* **deps:** update all non-major dependencies to v17.0.2 ([0e9e2f0](0e9e2f0))
* **deps:** update all non-major dependencies to v18.1.0 ([cd3ed19](cd3ed19))
* **deps:** update all non-major dependencies to v18.2.0 ([cd99aa3](cd99aa3))
* **deps:** update dependencies, remove ts-jest ([789ec69](789ec69))
* **deps:** update dependency did-resolver to v1.1.0 ([decentralized-identity#39](https://github.com/veramolabs/peer-did-resolver/issues/39)) ([4ade39d](4ade39d))
* **deps:** update dependency did-resolver to v2 ([decentralized-identity#56](https://github.com/veramolabs/peer-did-resolver/issues/56)) ([b420866](b420866))
* **deps:** update dependency did-resolver to v2.1.1 ([decentralized-identity#70](https://github.com/veramolabs/peer-did-resolver/issues/70)) ([0a0f902](0a0f902))
* **deps:** update dependency did-resolver to v3 ([decentralized-identity#94](https://github.com/veramolabs/peer-did-resolver/issues/94)) ([18d1a1d](18d1a1d))
* **deps:** Update dependency did-resolver to v3.1.1 ([91cc1c6](91cc1c6))
* **deps:** Update dependency did-resolver to v3.1.2 ([7902b3f](7902b3f))
* **deps:** Update dependency did-resolver to v3.1.3 ([d77839f](d77839f))
* **deps:** Update dependency did-resolver to v3.1.4 ([02d4c7d](02d4c7d))
* **deps:** Update dependency did-resolver to v3.1.5 ([0728ffb](0728ffb))
* **deps:** Update dependency did-resolver to v3.2.0 ([d33f51e](d33f51e))
* **deps:** Update dependency did-resolver to v3.2.2 ([f494fbe](f494fbe))
* **deps:** Update dependency did-resolver to v4 ([74b825f](74b825f))
* **deps:** Update dependency did-resolver to v4.0.1 ([63d7fc2](63d7fc2))
* **deps:** update dependency react-scripts to v5 ([bbc4b35](bbc4b35))
* **deps:** update dependency react-scripts to v5.0.1 ([36d0e22](36d0e22))
* **deps:** update react monorepo to v18 ([8f21c88](8f21c88))
* remove checks for a [@context](https://github.com/context) field ([b814b6c](b814b6c)), closes [decentralized-identity#26](https://github.com/veramolabs/peer-did-resolver/issues/26)

### Features

* refactor to resolve peer-did ([e04640c](e04640c))
* remove default export ([3952bef](3952bef))
* remove default export ([9ef0b37](9ef0b37))
* support for path in the did ([904d88c](904d88c)), closes [decentralized-identity#32](https://github.com/veramolabs/peer-did-resolver/issues/32) [decentralized-identity#33](https://github.com/veramolabs/peer-did-resolver/issues/33)
* update to latest did spec ([decentralized-identity#92](https://github.com/veramolabs/peer-did-resolver/issues/92)) ([4779436](4779436)), closes [decentralized-identity#91](https://github.com/veramolabs/peer-did-resolver/issues/91)
* use cross-fetch instead of XMLHttpRequest ([decentralized-identity#15](https://github.com/veramolabs/peer-did-resolver/issues/15)) ([dadf682](dadf682))
* use cross-fetch instead of XMLHttpRequest ([decentralized-identity#15](https://github.com/veramolabs/peer-did-resolver/issues/15)) ([4378c71](4378c71))

### BREAKING CHANGES

* Resolver now returns a `DIDResolutionResult` that wraps a DIDDocument. No errors are thrown, instead returned as `didResolutionMetadata.error/message`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage This issue is currently being examined
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants