I'm hosting an Angular application inside a Spring Boot application.
Accessing routes like
- https://localhost:8081/sign-in
- https://localhost:8081/invalid-url (redirects to
PageNotFoundComponent
)
is not an issue. However, if I access somthing below /profile
:
I'll get an actual JSON responses, preventing the actual web-client to be loaded (see animation below).
After setting the debug-level on root
to DEBUG
, I saw the following:
: GET "/profile", parameters={}
: Mapped to org.springframework...ProfileController#listAllFormsOfMetadata()
and indeed, the code reaches org.springframework.data.rest.webmvc.ProfileController#listAllFormsOfMetadata()
and I don't know how to disable this behavior or why this endpoint is being exposed in the first place.
Since Spring is exposing JPA-Repositories on default, I am already disabling this default behavior like so:
@Configuration
public class SpringRestConfiguration implements RepositoryRestConfigurer {
@Override
public void configureRepositoryRestConfiguration(
RepositoryRestConfiguration config, CorsRegistry cors
) {
config.disableDefaultExposure();
}
}
How can I fix (disable) this behavior?