Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
22b154a0
Commit
22b154a0
authored
Oct 24, 2017
by
Matija Obreza
Browse files
CORS enabled in Spring Security
- Set CORS headers for /html/** - Updated JSPs with CDN links
parent
474d143f
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/server/servlet/controller/RobotsTxtController.java
View file @
22b154a0
...
...
@@ -34,7 +34,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
@RequestMapping
(
"/robots.txt"
)
public
class
RobotsTxtController
{
@Value
(
"${
base.host
}"
)
@Value
(
"${
host.name
}"
)
private
String
host
;
@Value
(
"${robots.allow}"
)
...
...
src/main/java/org/genesys2/spring/config/SecurityConfig.java
View file @
22b154a0
...
...
@@ -141,6 +141,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// CSRF
.
and
().
csrf
()
// cors
.
and
().
cors
()
// Logout and login
.
and
().
logout
().
logoutUrl
(
"/logout"
).
logoutSuccessUrl
(
"/"
)
...
...
src/main/java/org/genesys2/spring/config/WebConfiguration.java
View file @
22b154a0
...
...
@@ -174,7 +174,7 @@ public class WebConfiguration extends WebMvcConfigurerAdapter {
// .exposedHeaders("header1", "header2")
// .allowCredentials(false).maxAge(3600);
registry
.
addMapping
(
"/html/**"
).
allowCredentials
(
false
).
allowedMethods
(
"GET"
,
"OPTIONS"
,
"HEAD"
).
allowedOrigins
(
baseUrl
);
registry
.
addMapping
(
"/html/**"
).
allowCredentials
(
false
).
allowedMethods
(
"GET"
,
"OPTIONS"
,
"HEAD"
).
allowedOrigins
(
baseUrl
)
.
maxAge
(
3600
)
;
}
public
MappingJackson2HttpMessageConverter
jacksonMessageConverter
()
{
...
...
src/main/webapp/WEB-INF/decorator/1/admin.jsp
View file @
22b154a0
...
...
@@ -63,7 +63,7 @@
<span
class=
"icon-bar"
></span>
</button>
<%--<a class="navbar-brand" href="<c:url value="/admin/" />"> <spring:message code="page.home.title" /> </a>--%>
<a
class=
"navbar-brand nav-logo clearfix"
href=
"
<c:url
value=
"/admin/"
/>
"
><img
src=
"/html/1/images/GENESYS-ICON.svg"
/><img
src=
"/html/1/images/GENESYS-LOGO.svg"
/></a>
<a
class=
"navbar-brand nav-logo clearfix"
href=
"
<c:url
value=
"/admin/"
/>
"
><img
src=
"
<c:url
value=
"
${
cdnServers
.
next
}
/html/1/images/GENESYS-ICON.svg"
/>
"
/><img
src=
"/html/1/images/GENESYS-LOGO.svg"
/></a>
</div>
<div
id=
"navbar"
class=
"collapse navbar-collapse"
>
<div
class=
"col-md-7 col-lg-10 no-space"
>
...
...
@@ -75,7 +75,7 @@
<span
class=
"icon-bar"
></span>
</button>
<%--<a class="navbar-brand" href="<c:url value="/admin/" />"> <spring:message code="page.home.title" /> </a>--%>
<a
class=
"navbar-brand nav-logo clearfix"
href=
"
<c:url
value=
"/admin/"
/>
"
><img
src=
"/html/1/images/GENESYS-ICON.svg"
/><img
src=
"/html/1/images/GENESYS-LOGO.svg"
/></a>
<a
class=
"navbar-brand nav-logo clearfix"
href=
"
<c:url
value=
"/admin/"
/>
"
><img
src=
"
<c:url
value=
"
${
cdnServers
.
next
}
/html/1/images/GENESYS-ICON.svg"
/>
"
/><img
src=
"
<c:url
value=
"
${
cdnServers
.
next
}
/html/1/images/GENESYS-LOGO.svg"
/>
"
/></a>
</div>
<ul
class=
"nav navbar-nav nav-menu-admin"
>
...
...
src/main/webapp/WEB-INF/decorator/1/footer.jsp
View file @
22b154a0
...
...
@@ -8,7 +8,7 @@
<div
class=
"container-fluid"
>
<!-- <p class="text-muted">Place sticky footer content here.</p> -->
<div
class=
"footer-logo"
>
<a
href=
"
<c:url
value=
"/welcome"
/>
"
><img
src=
"
<c:url
value=
"/html/1/images/GENESYS-ICON.svg"
/>
"
alt=
"Genesys - Gateway to Genetic Resources"
/><img
src=
"
<c:url
value=
"/html/1/images/GENESYS-LOGO_black.svg"
/>
"
<a
href=
"
<c:url
value=
"/welcome"
/>
"
><img
src=
"
<c:url
value=
"
${
cdnServers
.
next
}
/html/1/images/GENESYS-ICON.svg"
/>
"
alt=
"Genesys - Gateway to Genetic Resources"
/><img
src=
"
<c:url
value=
"
${
cdnServers
.
next
}
/html/1/images/GENESYS-LOGO_black.svg"
/>
"
alt=
"Genesys - Gateway to Genetic Resources"
/></a>
</div>
...
...
src/main/webapp/WEB-INF/decorator/1/menu.jsp
View file @
22b154a0
...
...
@@ -10,7 +10,7 @@
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand nav-logo clearfix"
href=
"
<c:url
value=
"/welcome"
/>
"
><img
src=
"
<c:url
value=
"/html/1/images/GENESYS-ICON.svg"
/>
"
/><img
src=
"
<c:url
value=
"/html/1/images/GENESYS-LOGO.svg"
/>
"
/></a>
<a
class=
"navbar-brand nav-logo clearfix"
href=
"
<c:url
value=
"/welcome"
/>
"
><img
src=
"
<c:url
value=
"
${
cdnServers
.
next
}
/html/1/images/GENESYS-ICON.svg"
/>
"
/><img
src=
"
<c:url
value=
"
${
cdnServers
.
next
}
/html/1/images/GENESYS-LOGO.svg"
/>
"
/></a>
</div>
<div
id=
"navbar"
class=
"collapse navbar-collapse"
>
<div
class=
"col-md-6 col-lg-9 no-space"
>
...
...
@@ -21,7 +21,7 @@
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand nav-logo clearfix"
href=
"
<c:url
value=
"/welcome"
/>
"
><img
src=
"/html/1/images/GENESYS-ICON.svg"
/><img
src=
"/html/1/images/GENESYS-LOGO.svg"
/></a>
<a
class=
"navbar-brand nav-logo clearfix"
href=
"
<c:url
value=
"/welcome"
/>
"
><img
src=
"
<c:url
value=
"
${
cdnServers
.
next
}
/html/1/images/GENESYS-ICON.svg"
/>
"
/><img
src=
"
<c:url
value=
"
${
cdnServers
.
next
}
/html/1/images/GENESYS-LOGO.svg"
/>
"
/></a>
</div>
<ul
class=
"nav navbar-nav nav-menu"
id=
"navigation-menu"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment