@times-components/ssr 2.44.26 → 2.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@times-components/ssr",
3
3
  "main": "src",
4
- "version": "2.44.26",
4
+ "version": "2.45.0",
5
5
  "scripts": {
6
6
  "bundle:dev": "yarn cleanup-dist && webpack --config=webpack.config.js",
7
7
  "bundle:prod": "yarn cleanup-dist && NODE_ENV=production webpack --config=webpack.config.js -p",
@@ -52,8 +52,8 @@
52
52
  "webpack": "4.30.0"
53
53
  },
54
54
  "dependencies": {
55
- "@times-components/article": "7.13.108",
56
- "@times-components/author-profile": "6.15.22",
55
+ "@times-components/article": "7.13.109",
56
+ "@times-components/author-profile": "6.15.23",
57
57
  "@times-components/context": "1.10.26",
58
58
  "@times-components/provider": "1.38.0",
59
59
  "@times-components/schema": "0.7.4",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "ccd984665bc38c399cf9f64cf7b082e03a034c46"
82
+ "gitHead": "9a92e7282e35282088ff586c865ae8e588b423df"
83
83
  }
@@ -43,7 +43,7 @@ if (window.nuk && window.nuk.ssr && window.nuk.article) {
43
43
 
44
44
  const clientOptions = {
45
45
  rootTag,
46
- useGET: false,
46
+ useGET: true,
47
47
  headers: {
48
48
  "x-new-topic-data-source": true
49
49
  },
@@ -20,7 +20,13 @@ const makeClient = options => {
20
20
  }
21
21
 
22
22
  const networkInterfaceOptions = {
23
- fetch,
23
+ fetch: (url, opts) => {
24
+ const compressedUrl = url
25
+ .replace(/(%20)+/g, "%20")
26
+ .replace(/(%0A)+/g, "");
27
+
28
+ return fetch(compressedUrl, opts);
29
+ },
24
30
  headers: options.headers ? { ...options.headers } : {},
25
31
  uri: options.uri
26
32
  };
@@ -20,7 +20,13 @@ const makeClient = options => {
20
20
  }
21
21
 
22
22
  const networkInterfaceOptions = {
23
- fetch,
23
+ fetch: (url, opts) => {
24
+ const compressedUrl = url
25
+ .replace(/(%20)+/g, "%20")
26
+ .replace(/(%0A)+/g, "");
27
+
28
+ return fetch(compressedUrl, opts);
29
+ },
24
30
  headers: { "content-type": "application/json" },
25
31
  uri: options.uri
26
32
  };
@@ -29,6 +35,12 @@ const makeClient = options => {
29
35
  Object.assign(networkInterfaceOptions.headers, options.headers);
30
36
  }
31
37
 
38
+ if (options.useGET) {
39
+ networkInterfaceOptions.headers["content-type"] =
40
+ "application/x-www-form-urlencoded";
41
+ networkInterfaceOptions.useGETForQueries = true;
42
+ }
43
+
32
44
  const httpLink = createHttpLink(networkInterfaceOptions);
33
45
 
34
46
  const link = ApolloLink.from(