Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 674d3f5

Browse files
committed
Remove explicit initial application/json headers fix #262
1 parent 549987f commit 674d3f5

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

altair-spring-boot-autoconfigure/src/main/java/graphql/kickstart/altair/boot/AltairController.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import org.springframework.beans.factory.annotation.Autowired;
1717
import org.springframework.core.env.Environment;
1818
import org.springframework.core.io.ClassPathResource;
19-
import org.springframework.http.MediaType;
2019
import org.springframework.stereotype.Controller;
2120
import org.springframework.util.StreamUtils;
2221
import org.springframework.web.bind.annotation.PathVariable;
@@ -62,18 +61,9 @@ private void loadProps() throws IOException {
6261
private void loadHeaders() throws JsonProcessingException {
6362
PropertyGroupReader propertyReader = new PropertyGroupReader(environment, "graphiql.headers.");
6463
Properties headerProperties = propertyReader.load();
65-
addIfAbsent(headerProperties, "Accept");
66-
addIfAbsent(headerProperties, "Content-Type");
6764
this.headers = new ObjectMapper().writeValueAsString(headerProperties);
6865
}
6966

70-
71-
private void addIfAbsent(Properties headerProperties, String header) {
72-
if (!headerProperties.containsKey(header)) {
73-
headerProperties.setProperty(header, MediaType.APPLICATION_JSON_VALUE);
74-
}
75-
}
76-
7767
@RequestMapping(value = "${altair.mapping:/altair}")
7868
public void altair(HttpServletRequest request, HttpServletResponse response, @PathVariable Map<String, String> params) throws IOException {
7969
response.setContentType("text/html; charset=UTF-8");

altair-spring-boot-autoconfigure/src/main/resources/altair.html

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
/*Prevents the loading screen from showing until CSS is downloaded*/
2929
display: none;
3030
}
31-
32-
33-
34-
3531
</style>
3632
<div class="loading-screen styled">
3733
<div class="loading-screen-inner">
@@ -46,9 +42,9 @@
4642
</div>
4743
</div>
4844
</app-root>
49-
<script type="text/javascript" src="${altairRuntimeJsUrl}"></script>
50-
<script type="text/javascript" src="${altairPolyfillsJsUrl}"></script>
51-
<script type="text/javascript" src="${altairMainJsUrl}"></script>
45+
<script rel="preload" as="script" type="text/javascript" src="${altairRuntimeJsUrl}"></script>
46+
<script rel="preload" as="script" type="text/javascript" src="${altairPolyfillsJsUrl}"></script>
47+
<script rel="preload" as="script" type="text/javascript" src="${altairMainJsUrl}"></script>
5248
</body>
5349

5450
</html>

0 commit comments

Comments
 (0)