File tree Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -99,17 +99,6 @@ public function insertSubHooks ( $node ) {
99
99
return $ node ;
100
100
}
101
101
102
- public function insertForwardedFor ( $ node ) {
103
- if ( $ node ["type " ] == "sub " && $ node ["identifier " ] == "vcl_recv " ) {
104
- $ value = " set req.http.X-Forwarded-For = req.http.CF-Connecting-IP; " . $ node ["value " ];
105
- $ raw = "sub " . $ node ["identifier " ] . " { \n" . $ value . "\n} " ;
106
- $ node ["value " ] = $ value ;
107
- $ node ["raw " ] = $ raw ;
108
- return $ node ;
109
- }
110
- return $ node ;
111
- }
112
-
113
102
public function insertDeliver ( $ node ) {
114
103
if ( $ node ["type " ] == "sub " && $ node ["identifier " ] == "vcl_deliver " ) {
115
104
$ prefixed = implode ( "\n" , [
@@ -234,7 +223,6 @@ function generateDefault ( $vcl ) {
234
223
throw new Error ("Failed to customize config, please contact JetRails. " );
235
224
}
236
225
$ root = $ this ->insertHeaderComment ( $ root );
237
- $ root = $ this ->parser ->visit ( $ root , [ $ this , "insertForwardedFor " ] );
238
226
$ root = $ this ->parser ->visit ( $ root , [ $ this , "versionEndpoint " ] );
239
227
$ root = $ this ->parser ->visit ( $ root , [ $ this , "modifyRecv " ] );
240
228
$ root = $ this ->parser ->visit ( $ root , [ $ this , "insertBackendResponse " ] );
Original file line number Diff line number Diff line change 1
1
/**
2
2
* >jetrails_
3
- *
3
+ *
4
4
* This file should be included within the default VCL file. It exists to help
5
5
* customize the default VCL without having to modify the file itself. This way,
6
6
* the default VCL can be updated without having to port over any customizations
9
9
* hooking system. The available hooks can be found below in the form of
10
10
* subroutines. Their names end in either '_start' or '_end', to find when these
11
11
* subroutines are executed, refer to the default VCL file.
12
- *
12
+ *
13
13
* To keep things tidy, it is recommended that you include a description of the
14
14
* issue that the given code snippet solves as well as any helpful references
15
15
* that lead you to that solution.
16
- *
16
+ *
17
17
* Please Note: Native Varnish subroutines such as 'vcl_synth' can also be
18
18
* defined here since they are not currently being used by Magento. These
19
19
* subroutines will be used in the default VCL, but it is important to make sure
Original file line number Diff line number Diff line change 5
5
* looking to customize the config, please look into the 'default.custom.vcl'
6
6
* file which this config uses to implement it's hooking system.
7
7
*
8
- * Generated on Magento Community 2.4.2 with JetRails_Varnish@3.0.0
8
+ * Generated on Magento Community 2.4.2 with JetRails_Varnish@3.0.1
9
9
*/
10
10
11
11
# VCL version 5.0 is not supported so it should be 4.0 even though actually used Varnish version is 6
@@ -38,9 +38,9 @@ acl purge {
38
38
sub vcl_recv {
39
39
call custom_recv_start;
40
40
if (req.method == " GET" && client.ip ~ purge && req.url == " /jetrails/varnish-config/versions" ) {
41
- return (synth (200, "Magento 2.4.2 / Module 3.0.0 "));
41
+ return (synth (200, "Magento 2.4.2 / Module 3.0.1 "));
42
42
}
43
- set req.http.X-Forwarded-For = req.http.CF-Connecting-IP ;
43
+
44
44
if (req.restarts > 0 ) {
45
45
set req.hash_always_miss = true ;
46
46
}
@@ -153,7 +153,7 @@ sub vcl_hash {
153
153
if (req.http.X-Forwarded-Proto ) {
154
154
hash_data (req.http.X-Forwarded-Proto );
155
155
}
156
-
156
+
157
157
158
158
if (req.url ~ " /graphql" ) {
159
159
call process_graphql_headers;
You can’t perform that action at this time.
0 commit comments