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

Add origin option for nats websocket #315

Merged
merged 2 commits into from
Sep 9, 2021
Merged

Conversation

masudur-rahman
Copy link
Contributor

Signed-off-by: Masudur Rahman masudjuly02@gmail.com

allowed_origins is an important part for websocket.
To have the options available for user, I added the same_origin and allowed_origins field.

And also if TLS isn't enabled, no_tls field must be set true. That's why I added this.

@masudur-rahman masudur-rahman marked this pull request as draft September 2, 2021 11:37
Signed-off-by: Masudur Rahman <masudjuly02@gmail.com>
@masudur-rahman
Copy link
Contributor Author

Hey @wallyqs, can you take a look at this PR ?

@@ -354,6 +354,10 @@ data:
{{- else }}
no_tls: {{ .Values.websocket.noTLS }}
{{- end }}
same_origin: {{ .Values.websocket.sameOrigin }}
{{- with .Values.websocket.allowedOrigins }}
allowed_origins: ["{{ first . }}" {{- range (rest .) }}, "{{ . }}" {{- end }}]
Copy link
Member

Choose a reason for hiding this comment

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

Might be simpler to use toRawJson so that it becomes the array?

Suggested change
allowed_origins: ["{{ first . }}" {{- range (rest .) }}, "{{ . }}" {{- end }}]
allowed_origins: {{ toRawJson . }}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Might be simpler to use toRawJson so that it becomes the array?

@wallyqs, thanks for the suggestion. I've updated it. PTAL

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution!

Signed-off-by: Masudur Rahman <masudjuly02@gmail.com>
@wallyqs wallyqs merged commit d2e8dce into nats-io:main Sep 9, 2021
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