http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Mirror Origin header back in CORS response

Open matthias-ccri opened this issue 4 years ago • 10 comments

Use corser's origins option to handle the access-control-allow-origin header. Passing a true function will make corser mirror the Origin header like we want.

I was not able to run the tests because my port 8080 is not available. I tried to make the tests configurable but I couldn't get the cors.test.js server to use the right port with the httpServer.listen() calls. Hopefully the tests pass, but if they don't, I'll need some help debugging/rewriting the tests.

Relevant issues

Resolves https://github.com/http-party/http-server/issues/729

Contributor checklist
  • [x] Provide tests for the changes (unless documentation-only)
  • [ ] Documented any new features, CLI switches, etc. (if applicable)
    • [ ] Server --help output
    • [ ] README.md
    • [ ] doc/http-server.1 (use the same format as other entries)
  • [x] The pull request is being made against the master branch
Maintainer checklist
  • [ ] Assign a version triage tag
  • [ ] Approve tests if applicable

matthias-ccri avatar Nov 01 '21 17:11 matthias-ccri

@thornjad can you approve the workflow?

matthias-ccri avatar Nov 01 '21 17:11 matthias-ccri

"First-time contributors need a maintainer to approve running workflows."

I'm dying to know if the tests pass :)

matthias-ccri avatar Nov 03 '21 17:11 matthias-ccri

For some reason GH isn't giving me the option to approve, could you maybe try merging master again?

thornjad avatar Dec 16 '21 16:12 thornjad

Here's what I did, but it seemed to already be up to date?:


$ git remote get-url origin
https://github.com/matthias-ccri/http-server.git
$ git remote add upstream https://github.com/http-party/http-server.git
$ git pull upstream master
From https://github.com/http-party/http-server
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> upstream/master
Already up to date.
$ git push origin master
Everything up-to-date
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

On the matthias-ccri/http-server repo it's showing: image

Is the issue still there?

matthias-ccri avatar Dec 16 '21 16:12 matthias-ccri

Can this be merged?

matthias-ccri avatar Feb 16 '22 04:02 matthias-ccri

@thornjad is there a reason to not merge this?

matthias-ccri avatar Sep 27 '22 15:09 matthias-ccri

@thornjad This MR has been ready to merge for 9 months.

matthias-ccri avatar Oct 28 '22 15:10 matthias-ccri

This PR has been open for 553 days (or 18 months). @thornjad is there hesitation to this change or is there an issue with the PR?

matthias-ccri avatar May 08 '23 19:05 matthias-ccri

@thornjad

matthias-ccri avatar Jul 28 '23 05:07 matthias-ccri

@BigBlueHat is there any maintainer still interested in this package?

zbynek avatar Jul 28 '23 08:07 zbynek