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

Server: Resolves #7580: Allowed APP_BASE_URL in CORS #7681

Closed
wants to merge 1 commit into from

Conversation

carlosngo
Copy link
Contributor

@carlosngo carlosngo commented Jan 28, 2023

Resolves #7580

Current Behavior:

If request origin is not equal (or similar) to the following:

  • https://joplinapp.org
  • http:https://localhost:8077 (if dev)
  • USER_CONTENT_BASE_URL environment variable

https://joplinapp.org is returned as the Access-Control-Allow-Origin header by default.

origin: (ctx: AppContext) => {
	const origin = ctx.request.header.origin;

	if (acceptOrigin(origin)) {
		return origin;
	} else {
		// we can't return void, so let's return one of the valid domains
		return corsAllowedDomains[0];
	}
},

This PR attempts to add the APP_BASE_URL environment variable to the allowed domains.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@carlosngo
Copy link
Contributor Author

Hi @laurent22, first time contributing to this repo; let me know if there's anything I can improve on 😄

@carlosngo
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@laurent22
Copy link
Owner

Sorry I can't evaluate the impact of this change and I don't want to break existing Joplin Server installations, let alone Joplin Cloud, so I'd rather not merge. The linked issue simply asks to remove joplinapp.org, and we may do that but that's very low priority

@laurent22 laurent22 closed this Jan 28, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants