Skip to content

Commit

Permalink
Encode source name before sending
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-sgaron committed Sep 28, 2021
1 parent d8eb660 commit 51559ed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/routes/manage/signature_sources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ const WrappedSourceDetail = ({ service, base, close, reload }) => {
const saveChanges = () => {
apiCall({
method: base ? 'POST' : 'PUT',
url: base ? `/api/v4/signature/sources/${service}/${source.name}/` : `/api/v4/signature/sources/${service}/`,
url: base
? `/api/v4/signature/sources/${service}/${encodeURIComponent(source.name)}/`
: `/api/v4/signature/sources/${service}/`,
body: source,
onSuccess: () => {
showSuccessMessage(t(base ? 'change.success' : 'add.success'));
Expand All @@ -218,7 +220,7 @@ const WrappedSourceDetail = ({ service, base, close, reload }) => {
const executeDeleteSource = () => {
close();
apiCall({
url: `/api/v4/signature/sources/${service}/${source.name}/`,
url: `/api/v4/signature/sources/${service}/${encodeURIComponent(source.name)}/`,
method: 'DELETE',
onSuccess: () => {
showSuccessMessage(t('delete.success'));
Expand Down

0 comments on commit 51559ed

Please sign in to comment.