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

Parse content-scope if it is a string, for example a GET parameter #2502

Closed
wants to merge 1 commit into from

Conversation

lllHuber
Copy link
Contributor

@lllHuber lllHuber commented Sep 4, 2024

No description provided.

@lllHuber lllHuber force-pushed the parse-content-scope branch from 88bfaf2 to 253f4f5 Compare September 4, 2024 09:12
@thomasdax98 thomasdax98 removed their request for review September 10, 2024 06:57
Copy link
Collaborator

@johnnyomair johnnyomair left a comment

Choose a reason for hiding this comment

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

It would be nice if you could describe why you're making this change in the PR's description. Yes, I know, there's a Slack thread somewhere, but it requires a context switch to understand why you're changing this.

Also, should we add a changeset for this?

@@ -105,6 +105,9 @@ export class ContentScopeService {
return GqlExecutionContext.create(context).getArgs();
} else {
const request = context.switchToHttp().getRequest();
if (request.query?.scope) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (request.query?.scope) {
if (typeof request.query?.scope === "string") {

This would be more fitting for the PR title

@@ -105,6 +105,9 @@ export class ContentScopeService {
return GqlExecutionContext.create(context).getArgs();
} else {
const request = context.switchToHttp().getRequest();
if (request.query?.scope) {
request.query.scope = JSON.parse(request.query.scope);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could in theory lead to internal server exceptions:

image

Should we cover that?

@lllHuber lllHuber closed this Sep 17, 2024
@johnnyomair johnnyomair deleted the parse-content-scope branch September 17, 2024 06:59
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