mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 15:37:45 +00:00
[web] make it possible to run static viewer in subdirectories
This commit is contained in:
parent
721f7cc92e
commit
58642d57f6
@ -56,7 +56,7 @@ describe('save', () => {
|
|||||||
global.fetch = jest.fn()
|
global.fetch = jest.fn()
|
||||||
store.dispatch(OptionsActions.save())
|
store.dispatch(OptionsActions.save())
|
||||||
expect(fetch).toBeCalledWith(
|
expect(fetch).toBeCalledWith(
|
||||||
'/options/save?_xsrf=undefined',
|
'./options/save?_xsrf=undefined',
|
||||||
{
|
{
|
||||||
credentials: "same-origin",
|
credentials: "same-origin",
|
||||||
method: "POST"
|
method: "POST"
|
||||||
|
@ -91,6 +91,9 @@ export function fetchApi(url, options={}) {
|
|||||||
} else {
|
} else {
|
||||||
url += '.json'
|
url += '.json'
|
||||||
}
|
}
|
||||||
|
if (url.startsWith("/")) {
|
||||||
|
url = "." + url;
|
||||||
|
}
|
||||||
|
|
||||||
return fetch(url, {
|
return fetch(url, {
|
||||||
credentials: 'same-origin',
|
credentials: 'same-origin',
|
||||||
|
Loading…
Reference in New Issue
Block a user