Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

fix(cors): 解决put请求跨域问题 #201

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)

response.setHeader("Access-Control-Allow-Origin", request.getHeader(HttpHeaders.ORIGIN));
response.setHeader("Access-Control-Allow-Credentials", "true");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Allow-Methods", "POST, PUT, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "Content-Type, DBHUB, uid");
chain.doFilter(req, res);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ public ConnectInfo toInfo(Long dataSourceId, String database, Long consoleId) {
connectInfo.setUrl(dataSource.getUrl());
connectInfo.setPort(dataSource.getPort() != null ? Integer.parseInt(dataSource.getPort()) : null);
connectInfo.setHost(dataSource.getHost());
connectInfo.setGmtModified(dataSource.getGmtModified());
return connectInfo;
}

public ConnectInfo toInfo(Long dataSourceId, String database) {
return toInfo(dataSourceId, database, null);
}
}
}