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

Cookies added through the express aren't being added in the final response in sitecore-jss-proxy package #819

Open
rupa29 opened this issue Sep 23, 2021 · 10 comments
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🌈 enhancement keep

Comments

@rupa29
Copy link

rupa29 commented Sep 23, 2021

Description

We are adding cookies and version header( a custom one we add to show the git commit number in the response) to the response using express before sending the request to SSR proxy. I see the version header in the browser but not the cookies. When I try to log the ServerResponse from config setHeaders I see the cookies. When I log from createViewBag I don't see cookies in the serverResponse object anymore but i can see version header.

Expected behavior

Take into account cookies added by express when handling proxyResponse in SSR Proxy.

Steps To Reproduce

Using express, add cookies to the response before ssr proxy is registered.

Possible Fix

Don't delete set-cookie headers from serverResponse object and include them in the final response.

Your Environment

  • Sitecore Version:10.1.1
  • JSS Version: 16.0.0
  • sitecore-jss-proxy version: 16.0.0
  • Browser Name and version: Chrome version 92
  • Operating System and version (desktop or mobile): Mac
@CobyPear
Copy link
Contributor

CobyPear commented Sep 24, 2021

Hi @rupa29, is it possible for you to provide a code snippet? Are you using the provided setHeaders() hook in your ProxyConfig which is still stripping out your cookies?

See chimurai/http-proxy-middleware#472 (comment) as well, could be related.

@rupa29
Copy link
Author

rupa29 commented Sep 24, 2021

Hi @CobyPear I'm not allowed to share the code. Will you be available for a call? I can go over what we are doing. We use setHeaders in the proxy config but cookies are set before that.

@nickwesselman
Copy link
Contributor

@rupa29 Our product team, who supports GitHub issues, can't do calls. Perhaps you could reproduce the issue in a simpler, non-customer codebase which you are able to share? Otherwise you can utilize Sitecore Support.

@rupa29
Copy link
Author

rupa29 commented Sep 29, 2021

@nickwesselman We will be reaching out to Sitecore Support. Thank you

@nickwesselman
Copy link
Contributor

@rupa29 Were you able to resolve this?

@rupa29
Copy link
Author

rupa29 commented Nov 19, 2021

@nickwesselman We are able to find a work around for now. But we want this to be fixed

@nickwesselman
Copy link
Contributor

@rupa29 Can you provide the internal ticket # so we can reference?

@rupa29
Copy link
Author

rupa29 commented Nov 19, 2021

@nickwesselman Here it is CS0273427

@nickwesselman
Copy link
Contributor

@rupa29 Looks like we are still awaiting a sample that demonstrates the issue there as well.

@rupa29
Copy link
Author

rupa29 commented Nov 19, 2021

@nickwesselman We demonstrated the issue to one of the sitecore team members they are aware of the issue.

@illiakovalenko illiakovalenko added the backlog Issue/PR/discussion is reviewed and added to backlog for the further work label Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🌈 enhancement keep
Projects
None yet
Development

No branches or pull requests

5 participants