diff options
author | Matthew Shao <me@matshao.com> | 2018-08-13 15:17:57 +0800 |
---|---|---|
committer | Matthew Shao <me@matshao.com> | 2018-08-13 15:20:08 +0800 |
commit | e9e2b7f443a1395a169d853ffd4e692485e9da1a (patch) | |
tree | d520a35081600e401cbf850ec5dc12ff75fa1e3a | |
parent | e74e97bcd96346a1ae8c372a94149100a755739a (diff) | |
download | mitmproxy-e9e2b7f443a1395a169d853ffd4e692485e9da1a.tar.gz mitmproxy-e9e2b7f443a1395a169d853ffd4e692485e9da1a.tar.bz2 mitmproxy-e9e2b7f443a1395a169d853ffd4e692485e9da1a.zip |
[web] Fixes #3228:API endpoint error
-rw-r--r-- | web/src/js/__tests__/ducks/flowsSpec.js | 2 | ||||
-rw-r--r-- | web/src/js/ducks/flows.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/web/src/js/__tests__/ducks/flowsSpec.js b/web/src/js/__tests__/ducks/flowsSpec.js index d749d9e1..2bc5b38e 100644 --- a/web/src/js/__tests__/ducks/flowsSpec.js +++ b/web/src/js/__tests__/ducks/flowsSpec.js @@ -159,7 +159,7 @@ describe('flows actions', () => { store.dispatch(flowActions.uploadContent(tflow, 'foo', 'foo')) // window.Blob's lastModified is always the current time, // which causes flaky tests on comparison. - expect(fetchApi).toBeCalledWith('/flows/1/foo/content', { method: 'POST', body: expect.anything()}) + expect(fetchApi).toBeCalledWith('/flows/1/foo/content.data', { method: 'POST', body: expect.anything()}) }) it('should handle clear action', () => { diff --git a/web/src/js/ducks/flows.js b/web/src/js/ducks/flows.js index 523ec396..841feeba 100644 --- a/web/src/js/ducks/flows.js +++ b/web/src/js/ducks/flows.js @@ -209,7 +209,7 @@ export function uploadContent(flow, file, type) { const body = new FormData() file = new window.Blob([file], { type: 'plain/text' }) body.append('file', file) - return dispatch => fetchApi(`/flows/${flow.id}/${type}/content`, { method: 'POST', body }) + return dispatch => fetchApi(`/flows/${flow.id}/${type}/content.data`, { method: 'POST', body }) } |