Skip to content

Commit

Permalink
CORS fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
YanhuiJessica committed Feb 24, 2021
1 parent 18a127d commit 10c55ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import jsonServerProvider from 'ra-data-json-server';
import { AttackPatternList,AttackPatternEdit ,AttackPatternCreate } from './AttackPatterns';
import { RelationshipCreate,RelationshipEdit,RelationshipList } from "./Relationship";

const dataProvider = jsonServerProvider("http://localhost:6868");
const dataProvider = jsonServerProvider("http://attack-seaman.com:6868");
const Title = () => (<div>Mitre Attack</div>)

const App = () => (
Expand Down
4 changes: 2 additions & 2 deletions src/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func Create(db *database.TenDatabase, vInfo *model.VersionInfo, conf *config.Con
ctx.Header("Content-Type", "application/json")
origin := ctx.Request.Header.Get("Origin")
for header, value := range conf.Server.ResponseHeaders {
if origin == "http://localhost:3000" && header == "Access-Control-Allow-Origin" {
ctx.Header("Access-Control-Allow-Origin", "http://localhost:3000")
if origin == "http://attack-seaman.com:3000" && header == "Access-Control-Allow-Origin" {
ctx.Header("Access-Control-Allow-Origin", "http://attack-seaman.com:3000")
} else {
ctx.Header(header, value)
}
Expand Down

0 comments on commit 10c55ae

Please sign in to comment.