Skip to content

Stricter CORS headers #58

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

Merged
merged 3 commits into from
Jan 23, 2016
Merged

Stricter CORS headers #58

merged 3 commits into from
Jan 23, 2016

Conversation

atosatto
Copy link
Contributor

Trying to fix issue #56 during the Torino HackNight contest.

The idea is basically to select a pair of free port from port-range using the net.Listen function.
The two ports are later used by gin to listen for incoming HTTP or HTTPS connections.

}
portSSL, err := getBindPort(portPlain+1, 9001)
Copy link
Contributor

Choose a reason for hiding this comment

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

You can maybe add a comment here to explain why you're passing portPlain+1. I heard people confused by it in the office. But of course if you find a free port, the previous are all occupied, and there's no reason to cycle through them again.

@matteosuppo matteosuppo self-assigned this Jan 22, 2016
@matteosuppo
Copy link
Contributor

I tested it with different listening services on different ports and it works. Just add that comment and we can merge it.

@atosatto
Copy link
Contributor Author

I've added a comment as you suggested. Maybe it's a little bit verbose, but it should clarify why I'm passing portPlain+1.

Signed-off-by: Andrea Tosatto <[email protected]>
matteosuppo added a commit that referenced this pull request Jan 23, 2016
@matteosuppo matteosuppo merged commit d9eca8e into arduino:devel Jan 23, 2016
@matteosuppo
Copy link
Contributor

Thank you very much

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.

2 participants