File tree 6 files changed +12
-13
lines changed
spring-test/src/test/java/org/springframework/test
main/resources/org/springframework/http
test/java/org/springframework/http
spring-webflux/src/test/java/org/springframework/web/reactive/resource 6 files changed +12
-13
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2022 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -64,7 +64,7 @@ void controller(@Value("${test.engine}") String testEngine) throws Exception {
64
64
void resources () throws Exception {
65
65
this .mockMvc .perform (get ("/resources/Spring.js" ))
66
66
.andExpectAll (
67
- content ().contentType ("application /javascript" ),
67
+ content ().contentType ("text /javascript" ),
68
68
content ().string (containsString ("Spring={};" ))
69
69
);
70
70
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -69,7 +69,7 @@ public void resourceRequest() {
69
69
testClient .get ().uri ("/resources/Spring.js" )
70
70
.exchange ()
71
71
.expectStatus ().isOk ()
72
- .expectHeader ().contentType ("application /javascript" )
72
+ .expectHeader ().contentType ("text /javascript" )
73
73
.expectBody (String .class ).value (containsString ("Spring={};" ));
74
74
}
75
75
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -67,7 +67,7 @@ public void setup() {
67
67
@ Test
68
68
public void resourceRequest () throws Exception {
69
69
this .mockMvc .perform (get ("/resources/Spring.js" ))
70
- .andExpect (content ().contentType ("application /javascript" ))
70
+ .andExpect (content ().contentType ("text /javascript" ))
71
71
.andExpect (content ().string (containsString ("Spring={};" )));
72
72
}
73
73
Original file line number Diff line number Diff line change @@ -146,7 +146,7 @@ application/ipfix ipfix
146
146
application/java-archive jar
147
147
application/java-serialized-object ser
148
148
application/java-vm class
149
- application/javascript js
149
+ # application/javascript js
150
150
# application/jose
151
151
# application/jose+json
152
152
# application/jrd+json
@@ -1686,7 +1686,7 @@ text/csv csv
1686
1686
# text/fwdred
1687
1687
# text/grammar-ref-list
1688
1688
text/html html htm
1689
- # text/javascript
1689
+ text/javascript js
1690
1690
# text/jcr-cnd
1691
1691
# text/markdown
1692
1692
# text/mizar
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class MediaTypeFactoryTests {
30
30
@ Test
31
31
void getMediaType () {
32
32
assertThat (MediaTypeFactory .getMediaType ("file.xml" )).contains (MediaType .APPLICATION_XML );
33
- assertThat (MediaTypeFactory .getMediaType ("file.js" )).contains (MediaType .parseMediaType ("application /javascript" ));
33
+ assertThat (MediaTypeFactory .getMediaType ("file.js" )).contains (MediaType .parseMediaType ("text /javascript" ));
34
34
assertThat (MediaTypeFactory .getMediaType ("file.css" )).contains (MediaType .parseMediaType ("text/css" ));
35
35
assertThat (MediaTypeFactory .getMediaType ("file.foobar" )).isNotPresent ();
36
36
}
Original file line number Diff line number Diff line change @@ -606,7 +606,7 @@ void getResourceFromSubDirectory() throws Exception {
606
606
setBestMachingPattern (exchange , "/**" );
607
607
this .handler .handle (exchange ).block (TIMEOUT );
608
608
609
- assertThat (exchange .getResponse ().getHeaders ().getContentType ()).isEqualTo (MediaType .parseMediaType ("application /javascript" ));
609
+ assertThat (exchange .getResponse ().getHeaders ().getContentType ()).isEqualTo (MediaType .parseMediaType ("text /javascript" ));
610
610
assertResponseBody (exchange , "function foo() { console.log(\" hello world\" ); }" );
611
611
}
612
612
@@ -619,12 +619,11 @@ void getResourceFromSubDirectoryOfAlternatePath() throws Exception {
619
619
this .handler .handle (exchange ).block (TIMEOUT );
620
620
621
621
HttpHeaders headers = exchange .getResponse ().getHeaders ();
622
- assertThat (headers .getContentType ()).isEqualTo (MediaType .parseMediaType ("application /javascript" ));
622
+ assertThat (headers .getContentType ()).isEqualTo (MediaType .parseMediaType ("text /javascript" ));
623
623
assertResponseBody (exchange , "function foo() { console.log(\" hello world\" ); }" );
624
624
}
625
625
626
- @ Test
627
- // gh-27538, gh-27624
626
+ @ Test // gh-27538, gh-27624
628
627
void filterNonExistingLocations () throws Exception {
629
628
this .handler .afterPropertiesSet ();
630
629
ResourceWebHandler handler = new ResourceWebHandler ();
You can’t perform that action at this time.
0 commit comments