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

remove logic of api returning a "rendered" response as it can't happen #118

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

ricardo-devis-agullo
Copy link
Collaborator

@ricardo-devis-agullo ricardo-devis-agullo commented Aug 28, 2024

I'm looking at the logic, and for both calls (render and getData), we use the getHeaders function that always add the header Accept: 'application/vnd.oc.unrendered+json' to the request.

When that happens, the response is always going to be unrendered, with one single exception, which is when oc-client-node calls the endpoint and the template is not supported (see here). This can only happen with node, where the node client will send a specific oc-client user agent string, so I don't see how it can ever happen in a browser context.

I got to think that some time ago this code was somehow moved from server to client and found it's way there, but I think is 100% safe to remove.

@ricardo-devis-agullo ricardo-devis-agullo changed the title remove rendered logic as it can't happen remove logic of api returning a "rendered" response as it can't happen Aug 28, 2024
@ricardo-devis-agullo ricardo-devis-agullo merged commit 3637eb4 into master Aug 29, 2024
2 checks passed
@ricardo-devis-agullo ricardo-devis-agullo deleted the remove-rendered-logic branch August 29, 2024 09:49
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.

1 participant