gina 0.1.6-alpha.7 → 0.1.6-alpha.70

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.
Files changed (326) hide show
  1. package/README-4Contributors.md +14 -8
  2. package/README.md +3 -3
  3. package/bin/cli +13 -0
  4. package/bin/gina +29 -1
  5. package/framework/v0.1.6-alpha.70/VERSION +1 -0
  6. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/plugin/README.md +1 -0
  7. package/framework/v0.1.6-alpha.70/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
  8. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/plugin/dist/vendor/gina/js/gina.js +370 -75
  9. package/framework/v0.1.6-alpha.70/core/asset/plugin/dist/vendor/gina/js/gina.min.js +775 -0
  10. package/framework/v0.1.6-alpha.70/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
  11. package/framework/v0.1.6-alpha.70/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +8 -0
  12. package/framework/v0.1.6-alpha.70/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
  13. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/config.js +116 -33
  14. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/lib/connector.v4.js +28 -22
  15. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/controller/controller.js +357 -42
  16. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/.github/workflows/ci.yml +24 -0
  17. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/.github/workflows/lint.yml +23 -0
  18. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/LICENSE +19 -0
  19. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/README.md +191 -0
  20. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-big.js +149 -0
  21. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-small.js +143 -0
  22. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-big.js +154 -0
  23. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-small.js +148 -0
  24. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-100pairs-small.js +101 -0
  25. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-900pairs-small-alt.js +84 -0
  26. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/lib/index.js +57 -0
  27. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/lib/types/multipart.js +680 -0
  28. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/lib/types/urlencoded.js +350 -0
  29. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/lib/utils.js +596 -0
  30. package/framework/v0.1.6-alpha.70/core/deps/busboy-1.6.0/package.json +22 -0
  31. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/gna.js +97 -18
  32. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/model/index.js +28 -24
  33. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/validator/src/form-validator.js +5 -3
  34. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/validator/src/main.js +240 -53
  35. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/router.js +75 -40
  36. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/server.isaac.js +34 -8
  37. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/server.js +31 -5
  38. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle/controllers/setup.js +2 -2
  39. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/conf/templates.json +4 -2
  40. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/context.js +16 -11
  41. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/path.js +25 -9
  42. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/add.js +2 -1
  43. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/start.js +21 -8
  44. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/build.js +1 -1
  45. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/init.js +18 -0
  46. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/link-node-modules.js +2 -3
  47. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/link.js +1 -0
  48. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/tail.js +28 -11
  49. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/version.js +15 -1
  50. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/helper.js +6 -2
  51. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/add.js +3 -2
  52. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/build.js +4 -4
  53. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/protocol/list.js +71 -50
  54. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/collection/src/main.js +8 -0
  55. package/framework/v0.1.6-alpha.70/lib/domain/exemples/backend.js +12 -0
  56. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/domain/src/main.js +59 -1
  57. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/merge/package.json +1 -1
  58. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/model.js +1 -1
  59. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/routing/src/main.js +50 -11
  60. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/session-store.js +2 -2
  61. package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/swig-filters/src/main.js +64 -9
  62. package/framework/v0.1.6-alpha.70/package.json +12 -0
  63. package/package.json +2 -2
  64. package/utils/helper.js +24 -0
  65. package/framework/v0.1.6-alpha.7/VERSION +0 -1
  66. package/framework/v0.1.6-alpha.7/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +0 -1
  67. package/framework/v0.1.6-alpha.7/core/asset/plugin/dist/vendor/gina/js/gina.min.js +0 -765
  68. package/framework/v0.1.6-alpha.7/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +0 -8
  69. package/framework/v0.1.6-alpha.7/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -7
  70. package/framework/v0.1.6-alpha.7/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +0 -8
  71. package/framework/v0.1.6-alpha.7/lib/domain/exemples/backend.js +0 -0
  72. package/framework/v0.1.6-alpha.7/package.json +0 -14
  73. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/AUTHORS +0 -0
  74. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/LICENSE +0 -0
  75. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/html/nolayout.html +0 -0
  76. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/html/static.html +0 -0
  77. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/img/android-chrome-192x192.png +0 -0
  78. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/img/android-chrome-512x512.png +0 -0
  79. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/img/apple-touch-icon.png +0 -0
  80. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/img/favicon-16x16.png +0 -0
  81. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/img/favicon-32x32.png +0 -0
  82. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/img/favicon.ico +0 -0
  83. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
  84. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +0 -0
  85. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/asset/plugin/uuid.json +0 -0
  86. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/index.js +0 -0
  87. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/lib/connector.js +0 -0
  88. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  89. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  90. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/lib/n1ql.js +0 -0
  91. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/lib/session-store.js +0 -0
  92. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  93. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  94. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
  95. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/controller/controller.framework.js +0 -0
  96. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/controller/index.js +0 -0
  97. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/.travis.yml +0 -0
  98. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/LICENSE +0 -0
  99. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/README.md +0 -0
  100. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/deps/encoding/encoding-indexes.js +0 -0
  101. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/deps/encoding/encoding.js +0 -0
  102. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/lib/main.js +0 -0
  103. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/lib/types/multipart.js +0 -0
  104. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/lib/types/urlencoded.js +0 -0
  105. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/lib/utils.js +0 -0
  106. /package/framework/{v0.1.6-alpha.7/core/deps/busboy → v0.1.6-alpha.70/core/deps/busboy-0.2.14}/package.json +0 -0
  107. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  108. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/dev/index.js +0 -0
  109. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/dev/lib/class.js +0 -0
  110. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/dev/lib/factory.js +0 -0
  111. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/dev/lib/tools.js +0 -0
  112. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/README.md +0 -0
  113. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/currency.json +0 -0
  114. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/dist/language/en.json +0 -0
  115. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/dist/language/fr.json +0 -0
  116. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/dist/region/en.json +0 -0
  117. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/dist/region/fr.json +0 -0
  118. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/index.js +0 -0
  119. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/src/make.js +0 -0
  120. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/src/resources/currency.csv +0 -0
  121. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/src/resources/region.csv +0 -0
  122. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/locales/src/resources/region.mapping.json +0 -0
  123. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/mime.types +0 -0
  124. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/model/entity.js +0 -0
  125. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/model/template/entityFactory.js +0 -0
  126. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/model/template/index.js +0 -0
  127. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/README.md +0 -0
  128. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/index.js +0 -0
  129. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/file/README.md +0 -0
  130. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/file/build.json +0 -0
  131. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/file/package.json +0 -0
  132. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/intl/README.md +0 -0
  133. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/intl/build.json +0 -0
  134. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/intl/package.json +0 -0
  135. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/intl/src/main.js +0 -0
  136. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/storage/README.md +0 -0
  137. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/storage/build.json +0 -0
  138. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/storage/package.json +0 -0
  139. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/storage/src/main.js +0 -0
  140. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/validator/README.md +0 -0
  141. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/validator/build.json +0 -0
  142. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/plugins/lib/validator/package.json +0 -0
  143. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/server.express.js +0 -0
  144. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/status.codes +0 -0
  145. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/_gitignore +0 -0
  146. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle/config/app.json +0 -0
  147. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle/config/routing.json +0 -0
  148. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle/config/settings.json +0 -0
  149. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  150. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle/config/templates.json +0 -0
  151. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  152. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  153. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle/index.js +0 -0
  154. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  155. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  156. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  157. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  158. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  159. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_public/readme.md +0 -0
  160. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  161. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
  162. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
  163. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
  164. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
  165. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/command/gina.bat.tpl +0 -0
  166. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/command/gina.tpl +0 -0
  167. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/conf/env.json +0 -0
  168. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/conf/manifest.json +0 -0
  169. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/conf/package.json +0 -0
  170. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/conf/settings.json +0 -0
  171. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/conf/statics.json +0 -0
  172. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/error/client/json/401.json +0 -0
  173. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/error/client/json/403.json +0 -0
  174. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/error/client/json/404.json +0 -0
  175. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/error/server/html/50x.html +0 -0
  176. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/error/server/json/500.json +0 -0
  177. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/error/server/json/503.json +0 -0
  178. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/core/template/extensions/logger/config.json +0 -0
  179. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/console.js +0 -0
  180. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/data/LICENSE +0 -0
  181. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/data/README.md +0 -0
  182. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/data/package.json +0 -0
  183. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/data/src/main.js +0 -0
  184. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/dateFormat.js +0 -0
  185. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/index.js +0 -0
  186. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/json/LICENSE +0 -0
  187. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/json/README.md +0 -0
  188. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/json/package.json +0 -0
  189. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/json/src/main.js +0 -0
  190. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/plugins/README.md +0 -0
  191. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/plugins/package.json +0 -0
  192. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/plugins/src/api-error.js +0 -0
  193. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/plugins/src/main.js +0 -0
  194. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/prototypes.js +0 -0
  195. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/task.js +0 -0
  196. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/helpers/text.js +0 -0
  197. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/archiver/README.md +0 -0
  198. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/archiver/build.json +0 -0
  199. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/archiver/package.json +0 -0
  200. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/archiver/src/dep/jszip.min.js +0 -0
  201. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/archiver/src/main.js +0 -0
  202. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/aliases.json +0 -0
  203. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/arguments.json +0 -0
  204. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/copy.js +0 -0
  205. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/cp.js +0 -0
  206. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/help.js +0 -0
  207. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/help.txt +0 -0
  208. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/list.js +0 -0
  209. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/remove.js +0 -0
  210. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/rename.js +0 -0
  211. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/restart.js +0 -0
  212. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/rm.js +0 -0
  213. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/status.js +0 -0
  214. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/bundle/stop.js +0 -0
  215. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/add.js +0 -0
  216. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/get.js +0 -0
  217. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/help.js +0 -0
  218. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/help.txt +0 -0
  219. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/link-dev.js +0 -0
  220. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/list.js +0 -0
  221. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/remove.js +0 -0
  222. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/rm.js +0 -0
  223. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/set.js +0 -0
  224. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/unset.js +0 -0
  225. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/env/use.js +0 -0
  226. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/dot.js +0 -0
  227. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/get.js +0 -0
  228. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/help.js +0 -0
  229. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/help.txt +0 -0
  230. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/msg.json +0 -0
  231. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/open.js +0 -0
  232. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/restart.js +0 -0
  233. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/set.js +0 -0
  234. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/start.js +0 -0
  235. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/status.js +0 -0
  236. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/stop.js +0 -0
  237. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/framework/update.js +0 -0
  238. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/gina-dev.1.md +0 -0
  239. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/gina-framework.1.md +0 -0
  240. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/gina.1.md +0 -0
  241. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/index.js +0 -0
  242. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/msg.json +0 -0
  243. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/port/help.js +0 -0
  244. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/port/help.txt +0 -0
  245. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/port/inc/scan.js +0 -0
  246. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/port/list.js +0 -0
  247. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/port/reset.js +0 -0
  248. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/port/set.js +0 -0
  249. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/arguments.json +0 -0
  250. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/help.js +0 -0
  251. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/help.txt +0 -0
  252. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/import.js +0 -0
  253. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/list.js +0 -0
  254. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/move.js +0 -0
  255. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/remove.js +0 -0
  256. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/rename.js +0 -0
  257. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/restart.js +0 -0
  258. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/rm.js +0 -0
  259. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/start.js +0 -0
  260. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/status.js +0 -0
  261. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/project/stop.js +0 -0
  262. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/protocol/help.js +0 -0
  263. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/protocol/help.txt +0 -0
  264. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/protocol/set.js +0 -0
  265. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/scope/add.js +0 -0
  266. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/scope/help.js +0 -0
  267. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/scope/help.txt +0 -0
  268. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/scope/link-local.js +0 -0
  269. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/scope/link-production.js +0 -0
  270. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/scope/list.js +0 -0
  271. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/scope/remove.js +0 -0
  272. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/scope/rm.js +0 -0
  273. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/scope/use.js +0 -0
  274. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cmd/view/add.js +0 -0
  275. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/collection/README.md +0 -0
  276. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/collection/build.json +0 -0
  277. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/collection/package.json +0 -0
  278. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/config.js +0 -0
  279. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cron/README.md +0 -0
  280. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cron/package.json +0 -0
  281. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/cron/src/main.js +0 -0
  282. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/domain/LICENSE +0 -0
  283. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/domain/README.md +0 -0
  284. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/domain/dist/public_suffix_list.dat +0 -0
  285. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/domain/exemples/frontend.html +0 -0
  286. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/domain/package.json +0 -0
  287. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/generator/index.js +0 -0
  288. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/index.js +0 -0
  289. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/inherits/LICENSE +0 -0
  290. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/inherits/README.md +0 -0
  291. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  292. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/inherits/example/protected_inheritance.js +0 -0
  293. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/inherits/example/simple_inheritance.js +0 -0
  294. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  295. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/inherits/package.json +0 -0
  296. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/inherits/src/main.js +0 -0
  297. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/README.md +0 -0
  298. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/package.json +0 -0
  299. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/src/containers/default/index.js +0 -0
  300. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/src/containers/file/index.js +0 -0
  301. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  302. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  303. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/src/containers/mq/index.js +0 -0
  304. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/src/containers/mq/listener.js +0 -0
  305. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/src/containers/mq/speaker.js +0 -0
  306. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/src/helper.js +0 -0
  307. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/logger/src/main.js +0 -0
  308. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/math/index.js +0 -0
  309. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/merge/README.md +0 -0
  310. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/merge/example/merge.js +0 -0
  311. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/merge/example/merge_2_literal objects.js +0 -0
  312. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/merge/example/merge_and_preserve_first.js +0 -0
  313. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/merge/src/main.js +0 -0
  314. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/proc.js +0 -0
  315. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/routing/README.md +0 -0
  316. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/routing/build.json +0 -0
  317. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/routing/package.json +0 -0
  318. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/shell.js +0 -0
  319. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/swig-filters/README.md +0 -0
  320. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/swig-filters/package.json +0 -0
  321. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/url/README.md +0 -0
  322. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/url/index.js +0 -0
  323. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/url/mocks.json +0 -0
  324. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/url/routing.json +0 -0
  325. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/url/test.js +0 -0
  326. /package/framework/{v0.1.6-alpha.7 → v0.1.6-alpha.70}/lib/validator.js +0 -0
@@ -13,7 +13,7 @@ const {promises: {readFile}} = require("fs");
13
13
  var util = require('util');
14
14
  var promisify = util.promisify;
15
15
  var EventEmitter = require('events').EventEmitter;
16
- var zlib = require('zlib');
16
+ var zlib = require('zlib'); // Included with NodeJS
17
17
 
18
18
  //var dns = require('dns');
19
19
  // var tls = require('tls');
@@ -25,6 +25,8 @@ var inherits = lib.inherits;
25
25
  var console = lib.logger;
26
26
  var Collection = lib.Collection;
27
27
  var routingLib = lib.routing;
28
+ var Domain = lib.Domain;
29
+ var domainLib = new Domain();
28
30
  var swig = require('swig');
29
31
  // Swig 2
30
32
  // var swig = require('./../deps/swig-client/swig-2.0.0.min.js');
@@ -322,10 +324,24 @@ function SuperController(options) {
322
324
 
323
325
  var ctx = getContext('gina');
324
326
  // new declaration && overrides
327
+ var arch = process.arch;
328
+ switch (process.arch) {
329
+ case 'x64':
330
+ arch = 'amd64'
331
+ break;
332
+ case 'armv7l':
333
+ arch = 'armhf'
334
+ break;
335
+ case 'x86':
336
+ arch = 'i386'
337
+ break;
338
+ default:
339
+ break;
340
+ }
325
341
  var version = {
326
342
  "number" : ctx.version,
327
343
  "platform" : process.platform,
328
- "arch" : process.arch,
344
+ "arch" : arch,
329
345
  "nodejs" : process.versions.node,
330
346
  "middleware" : ctx.middleware
331
347
  };
@@ -343,8 +359,115 @@ function SuperController(options) {
343
359
  set('page.environment.scopeIsProduction', /^true$/i.test(process.env.NODE_SCOPE_IS_PRODUCTION) );
344
360
  set('page.environment.date.now', new Date().format("isoDateTime"));
345
361
 
362
+ // var requestPort = req.headers.port || req.headers[':port'];
363
+ // var isProxyHost = (
364
+ // typeof(req.headers.host) != 'undefined'
365
+ // && typeof(requestPort) != 'undefined'
366
+ // && /^(80|443)$/.test(requestPort)
367
+ // && local.options.conf.server.scheme +'://'+ req.headers.host +':'+ requestPort != local.options.conf.hostname.replace(/\:\d+$/, '') +':'+ local.options.conf.server.port
368
+ // ||
369
+ // typeof(req.headers[':authority']) != 'undefined'
370
+ // && local.options.conf.server.scheme +'://'+ req.headers[':authority'] != local.options.conf.hostname
371
+ // ||
372
+ // typeof(req.headers.host) != 'undefined'
373
+ // && typeof(requestPort) != 'undefined'
374
+ // && /^(80|443)$/.test(requestPort)
375
+ // && req.headers.host == local.options.conf.host
376
+ // ||
377
+ // typeof(req.headers['x-nginx-proxy']) != 'undefined'
378
+ // && /^true$/i.test(req.headers['x-nginx-proxy'])
379
+ // ) ? true : false;
380
+ // setContext('isProxyHost', isProxyHost);
381
+ var isProxyHost = getContext('isProxyHost') || false;
382
+ set('page.environment.isProxyHost', isProxyHost);
383
+ if ( /^true$/.test(isProxyHost) ) {
384
+ set('page.environment.proxyHost', process.gina.PROXY_HOST);
385
+ set('page.environment.proxyHostname', process.gina.PROXY_HOSTNAME);
386
+ }
387
+
388
+ var _config = ctx.config.envConf[options.conf.bundle][process.env.NODE_ENV];
389
+ // by default
390
+ var hostname = _config.hostname + _config.server.webroot;
391
+ var scheme = hostname.match(/^(https|http)/)[0];
392
+ var requestPort = (local.req.headers.port||local.req.headers[':port']);
393
+
394
+ var hostPort = hostname.match(/(\:d+\/|\:\d+)$/);
395
+ hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : _config.port[_config.server.protocol][_config.server.scheme];
396
+ // Linking bundle B from bundle A wihtout proxy
397
+ var isSpecialCase = (
398
+ getContext('bundle') != _config.bundle
399
+ && requestPort != hostPort
400
+ && local.req.headers[':host'] != process.gina.PROXY_HOST
401
+ ) ? true : false;
402
+
403
+ if (isSpecialCase) {
404
+ hostname = _config.hostname;
405
+ }
406
+
407
+ // if (
408
+ // isProxyHost
409
+ // && !isSpecialCase
410
+ // ) {
411
+ // // Rewrite hostname vs req.headers.host
412
+ // hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']);
413
+
414
+ // if (
415
+ // !/^(80|443)$/.test(requestPort)
416
+ // && !new RegExp(requestPort+'$').test(hostname)
417
+ // ) {
418
+ // hostname += ':'+ requestPort;
419
+ // }
420
+ // }
421
+
422
+ set('page.environment.hostname', hostname);
423
+ // Updating _config.rootDomain - 2024/04/15
424
+ // _config.rootDomain = domainLib.getRootDomain(hostname).value;
346
425
 
347
- var routing = local.options.conf.routing = ctx.config.envConf.routing; // all routes
426
+
427
+ set('page.environment.rootDomain', _config.rootDomain);
428
+ set('page.environment.webroot', options.conf.server.webroot);
429
+
430
+ if ( typeof(ctx.config.envConf._isRoutingUpdateNeeded) == 'undefined') {
431
+ ctx.config.envConf._isRoutingUpdateNeeded = false;
432
+ }
433
+
434
+ if (
435
+ typeof(ctx.config.envConf._proxyHostname) == 'undefined'
436
+ ||
437
+ hostname != ctx.config.envConf._proxyHostname
438
+ ) {
439
+ ctx.config.envConf._proxyHostname = (isProxyHost) ? hostname : null;
440
+ ctx.config.envConf._isRoutingUpdateNeeded = true;
441
+ }
442
+
443
+ if ( typeof(ctx.config.envConf._routingCloned) == 'undefined' ) {
444
+ ctx.config.envConf._routingCloned = JSON.clone(ctx.config.envConf.routing);
445
+ }
446
+
447
+ var routing = local.options.conf.routing = ctx.config.envConf._routingCloned; // all routes
448
+ if ( /^true$/i.test(ctx.config.envConf._isRoutingUpdateNeeded) ) {
449
+
450
+ for (let r in ctx.config.envConf.routing) {
451
+ if ( isProxyHost ) {
452
+ local.options.conf.routing[r].host = hostname.replace(/^(https|http)\:\/\//, '');
453
+ local.options.conf.routing[r].hostname = hostname;
454
+ let scheme = hostname.match(/^(https|http)/)[0];
455
+ local.options.conf.routing[r].hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']);
456
+ let requestPort = (local.req.headers.port||local.req.headers[':port']);
457
+ if (
458
+ !/^(80|443)$/.test(requestPort)
459
+ && !new RegExp(requestPort+'$').test(local.options.conf.routing[r].hostname)
460
+ ) {
461
+ local.options.conf.routing[r].hostname += ':'+ requestPort
462
+ }
463
+ continue;
464
+ }
465
+ local.options.conf.routing[r].host = ctx.config.envConf.routing[r].host;
466
+ local.options.conf.routing[r].hostname = ctx.config.envConf.routing[r].hostname;
467
+ }
468
+ ctx.config.envConf._isRoutingUpdateNeeded = false;
469
+
470
+ }
348
471
  set('page.environment.routing', encodeRFC5987ValueChars(JSON.stringify(routing))); // export for GFF
349
472
  //reverseRouting
350
473
  var reverseRouting = local.options.conf.reverseRouting = ctx.config.envConf.reverseRouting; // all routes
@@ -354,9 +477,8 @@ function SuperController(options) {
354
477
  set('page.environment.forms', encodeRFC5987ValueChars(JSON.stringify(forms))); // export for GFF
355
478
  set('page.forms', options.conf.content.forms);
356
479
 
357
- set('page.environment.hostname', ctx.config.envConf[options.conf.bundle][process.env.NODE_ENV].hostname);
358
- set('page.environment.rootDomain', ctx.config.envConf[options.conf.bundle][process.env.NODE_ENV].rootDomain);
359
- set('page.environment.webroot', options.conf.server.webroot);
480
+
481
+
360
482
  set('page.environment.bundle', options.conf.bundle);
361
483
  set('page.environment.project', options.conf.projectName);
362
484
  set('page.environment.protocol', options.conf.server.protocol);
@@ -437,11 +559,6 @@ function SuperController(options) {
437
559
  set('page.view.lang', userCulture);
438
560
  }
439
561
 
440
- if ( !getContext('isProxyHost') ) {
441
- var isProxyHost = ( typeof(req.headers.host) != 'undefined' && local.options.conf.server.scheme +'://'+ req.headers.host != local.options.conf.hostname || typeof(req.headers[':authority']) != 'undefined' && local.options.conf.server.scheme +'://'+ req.headers[':authority'] != local.options.conf.hostname ) ? true : false;
442
- setContext('isProxyHost', isProxyHost);
443
- isProxyHost = null;
444
- }
445
562
 
446
563
  //TODO - detect when to use swig
447
564
  var dir = null;
@@ -839,16 +956,64 @@ function SuperController(options) {
839
956
  return;
840
957
  }
841
958
 
959
+ var localRequestPort = local.req.headers.port || local.req.headers[':port'];
842
960
  var isProxyHost = (
843
961
  typeof(local.req.headers.host) != 'undefined'
844
- && localOptions.conf.server.scheme +'://'+ local.req.headers.host != localOptions.conf.hostname
845
- || typeof(local.req.headers[':authority']) != 'undefined'
846
- && localOptions.conf.server.scheme +'://'+ local.req.headers[':authority'] != localOptions.conf.hostname
962
+ && typeof(localRequestPort) != 'undefined'
963
+ && /^(80|443)$/.test(localRequestPort)
964
+ && localOptions.conf.server.scheme +'://'+ local.req.headers.host+':'+ localRequestPort != localOptions.conf.hostname.replace(/\:\d+$/, '') +':'+ localOptions.conf.server.port
965
+ ||
966
+ typeof(local.req.headers[':authority']) != 'undefined'
967
+ && localOptions.conf.server.scheme +'://'+ local.req.headers[':authority'] != localOptions.conf.hostname
968
+ ||
969
+ typeof(local.req.headers.host) != 'undefined'
970
+ && typeof(localRequestPort) != 'undefined'
971
+ && /^(80|443)$/.test(localRequestPort)
972
+ && local.req.headers.host == localOptions.conf.host
973
+ ||
974
+ typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
975
+ && /^true$/i.test(local.req.headers['x-nginx-proxy'])
976
+ ||
977
+ typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
847
978
  ) ? true : false;
979
+
980
+
981
+
982
+ // var ctx = getContext('gina');
983
+ // var _config = ctx.config.envConf[options.conf.bundle][process.env.NODE_ENV];
984
+ // // by default
985
+ // var hostname = _config.hostname + _config.server.webroot;
986
+ // var scheme = hostname.match(/^(https|http)/)[0];
987
+ // var requestPort = (local.req.headers.port||local.req.headers[':port']);
988
+
989
+ // var hostPort = hostname.match(/(\:d+\/|\:\d+)$/);
990
+ // hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : _config.port[_config.server.protocol][_config.server.scheme];
991
+ // // Linking bundle B from bundle A wihtout proxy
992
+ // var isSpecialCase = (
993
+ // getContext('bundle') != _config.bundle
994
+ // && requestPort != hostPort
995
+ // && local.req.headers[':host'] != process.gina.PROXY_HOST
996
+ // ) ? true : false;
997
+
998
+ // if (isSpecialCase) {
999
+ // hostname = _config.hostname;
1000
+ // }
1001
+ // if (
1002
+ // typeof(ctx.config.envConf._proxyHostname) == 'undefined'
1003
+ // ||
1004
+ // hostname != ctx.config.envConf._proxyHostname
1005
+ // ) {
1006
+ // ctx.config.envConf._proxyHostname = (isProxyHost) ? hostname : null;
1007
+ // ctx.config.envConf._isRoutingUpdateNeeded = true;
1008
+ // }
1009
+
1010
+
848
1011
  // setup swig default filters
849
1012
  var filters = SwigFilters({
850
1013
  options : JSON.clone(localOptions),
851
1014
  isProxyHost : isProxyHost,
1015
+ // _proxyHostname: ctx.config.envConf._proxyHostname,
1016
+ // _isRoutingUpdateNeeded: ctx.config.envConf._isRoutingUpdateNeeded,
852
1017
  throwError : self.throwError,
853
1018
  req : local.req,
854
1019
  res : local.res
@@ -883,6 +1048,7 @@ function SuperController(options) {
883
1048
  , XHRData = null
884
1049
  , XHRView = null
885
1050
  , isDeferModeEnabled = null
1051
+ , hasExternalsPlugins = null
886
1052
  , viewInfos = null
887
1053
  , filename = null
888
1054
  , isWithSwigLayout = null
@@ -1023,6 +1189,7 @@ function SuperController(options) {
1023
1189
  // }
1024
1190
 
1025
1191
  isDeferModeEnabled = localOptions.template.javascriptsDeferEnabled || localOptions.conf.content.templates._common.javascriptsDeferEnabled || false;
1192
+ hasExternalsPlugins = (localOptions.template.externalPlugins.length > 0) ? true : false;
1026
1193
 
1027
1194
  // iframe case - without HTML TAG
1028
1195
  if (!self.isXMLRequest() && !/\<html/.test(layout) ) {
@@ -1124,10 +1291,18 @@ function SuperController(options) {
1124
1291
  if (isLoadingPartial) {
1125
1292
  layout += '\t{{ page.view.scripts }}';
1126
1293
  } else {
1294
+ // placed in the HEAD
1127
1295
  if ( isDeferModeEnabled ) {
1128
1296
  layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1129
- } else { // placed in the BODY
1297
+ }
1298
+ // placed in the BODY
1299
+ else {
1130
1300
  layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
1301
+ if (hasExternalsPlugins) {
1302
+ for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
1303
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
1304
+ }
1305
+ }
1131
1306
  }
1132
1307
  }
1133
1308
 
@@ -1173,6 +1348,11 @@ function SuperController(options) {
1173
1348
  // layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1174
1349
  // } else { // placed in the BODY
1175
1350
  // layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
1351
+ // if (hasExternalsPlugins) {
1352
+ // for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
1353
+ // layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
1354
+ // }
1355
+ // }
1176
1356
  // }
1177
1357
  // }
1178
1358
 
@@ -1189,11 +1369,18 @@ function SuperController(options) {
1189
1369
  layout += '\t'+ localOptions.template.ginaLoader +'\n';
1190
1370
  }
1191
1371
  } else {
1372
+ // placed in the HEAD
1192
1373
  if ( isDeferModeEnabled && /\<\/head\>/i.test(layout) ) { // placed in the HEAD
1193
1374
  layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1194
-
1195
- } else { // placed in the BODY
1375
+ }
1376
+ // placed in the BODY
1377
+ else {
1196
1378
  layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
1379
+ if (hasExternalsPlugins) {
1380
+ for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
1381
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
1382
+ }
1383
+ }
1197
1384
  }
1198
1385
  // ginaLoader cannot be deferred
1199
1386
  if ( !localOptions.template.javascriptsExcluded || localOptions.template.javascriptsExcluded != '**' ) {
@@ -1619,7 +1806,11 @@ function SuperController(options) {
1619
1806
  var authority = ( typeof(local.req.headers['x-forwarded-proto']) != 'undefined' ) ? local.req.headers['x-forwarded-proto'] : local.options.conf.server.scheme;
1620
1807
  authority += '://'+ local.req.headers.host;
1621
1808
  var useWebroot = false;
1622
- if ( !/^\/$/.test(local.options.conf.server.webroot) && local.options.conf.server.webroot.length > 0 && local.options.conf.hostname.replace(/\:\d+$/, '') == authority ) {
1809
+ if (
1810
+ !/^\/$/.test(local.options.conf.server.webroot)
1811
+ && local.options.conf.server.webroot.length > 0
1812
+ // && local.options.conf.hostname.replace(/\:\d+$/, '') == authority
1813
+ ) {
1623
1814
  useWebroot = true
1624
1815
  }
1625
1816
  authority = null;
@@ -1630,11 +1821,19 @@ function SuperController(options) {
1630
1821
 
1631
1822
  //Get css
1632
1823
  if( viewConf.stylesheets ) {
1633
- cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL)
1824
+ // cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL);
1825
+ // Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
1826
+ var cssColl = new Collection(viewConf.stylesheets).orderBy({route: 'asc'})
1827
+ cssStr = getNodeRes('css', cssColl, useWebroot, reURL);
1828
+ cssColl = null;
1634
1829
  }
1635
1830
  //Get js
1636
1831
  if( viewConf.javascripts ) {
1637
- jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL)
1832
+ // jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL);
1833
+ // Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
1834
+ var jsColl = new Collection(viewConf.javascripts).orderBy({route: 'asc'})
1835
+ jsStr = getNodeRes('js', jsColl, useWebroot, reURL);
1836
+ jsColl = null;
1638
1837
  }
1639
1838
 
1640
1839
  set('page.view.stylesheets', cssStr);
@@ -1663,13 +1862,45 @@ function SuperController(options) {
1663
1862
  , rLen = resArr.length
1664
1863
  , obj = null
1665
1864
  , str = ''
1865
+ , isProxyHost = getContext('isProxyHost')
1666
1866
  , requestHost = ( /http\/2/.test(local.options.conf.server.protocol) )
1667
1867
  ? local.req.headers[':host']
1668
1868
  : local.req.headers.host
1669
1869
  , hostname = ( typeof(requestHost) != 'undefined' && local.options.conf.host != requestHost)
1670
- ? local.options.conf.server.scheme +'://'+ requestHost + ':'+ local.options.conf.server.port
1870
+ ? local.options.conf.server.scheme +'://'+ requestHost
1671
1871
  : local.options.conf.hostname
1872
+ , scheme = hostname.match(/^(https|http)/)[0]
1672
1873
  ;
1874
+ var requestPort = (local.req.headers.port||local.req.headers[':port']);
1875
+ var hostPort = local.options.conf.hostname.match(/(\:d+\/|\:\d+)$/);
1876
+ hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : local.options.conf.port[local.options.conf.server.protocol][local.options.conf.server.scheme];
1877
+ // Linking bundle B from bundle A wihtout proxy
1878
+ var isSpecialCase = (
1879
+ getContext('bundle') != local.options.conf.bundle
1880
+ && requestPort != hostPort
1881
+ && local.req.headers[':host'] != process.gina.PROXY_HOST
1882
+ ) ? true : false;
1883
+
1884
+ if (isSpecialCase) {
1885
+ hostname = local.options.conf.hostname
1886
+ }
1887
+
1888
+
1889
+ if (
1890
+ isProxyHost
1891
+ && !isSpecialCase
1892
+ ) {
1893
+
1894
+ hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']||process.gina.PROXY_HOST);
1895
+
1896
+ if (
1897
+ !/^(80|443)$/.test(requestPort)
1898
+ && !new RegExp(requestPort+'$').test(hostname)
1899
+ ) {
1900
+ hostname += ':'+ requestPort;
1901
+ }
1902
+ }
1903
+
1673
1904
  switch(type){
1674
1905
  case 'css':
1675
1906
  for (; r < rLen; ++r) {
@@ -1701,7 +1932,21 @@ function SuperController(options) {
1701
1932
  if (!/\:\/\//.test(obj.url) ) {
1702
1933
  obj.url = hostname + obj.url;
1703
1934
  }
1704
- str += '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>'
1935
+
1936
+
1937
+ if ( /\/jquery\.(.*)\.(min\.js|js)$/i.test(obj.url) ) {
1938
+ console.warn('jQuery Plugin found in templates.json !\nIf you want to load it before [gina.min.js], you should declare it at the top of your handler using requireJS or add property "isExternalPlugin: true" in your templates.json, under: '+ (obj.route || local.req.routing.rule) +' .');
1939
+ }
1940
+ // Allow jQuery & other external plugins to be loaded in the HEAD section before gina
1941
+ if (
1942
+ obj.isExternalPlugin
1943
+ ) {
1944
+ local.options.template.externalPlugins.splice(1, 0, '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>');
1945
+ }
1946
+ else {
1947
+ // normal case
1948
+ str += '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>';
1949
+ }
1705
1950
  }
1706
1951
  break;
1707
1952
  }
@@ -1895,9 +2140,9 @@ function SuperController(options) {
1895
2140
  // ignoreWebRoot = false
1896
2141
  // } else
1897
2142
  if (typeof(res) === 'string' || typeof(res) === 'number' || typeof(res) === 'boolean') {
1898
- if ( /true|1/.test(res) ) {
2143
+ if ( /^(true|1)$/i.test(res) ) {
1899
2144
  ignoreWebRoot = true
1900
- } else if ( /false|0/.test(res) ) {
2145
+ } else if ( /^(false|0)$/i.test(res) ) {
1901
2146
  ignoreWebRoot = false
1902
2147
  } else {
1903
2148
  res = local.res;
@@ -2015,8 +2260,37 @@ function SuperController(options) {
2015
2260
 
2016
2261
  if ( !self.forward404Unless(condition, req, res) ) { // forward to 404 if bad route
2017
2262
 
2018
- var isProxyHost = ( typeof(local.req.headers.host) != 'undefined' && local.options.conf.server.scheme +'://'+ local.req.headers.host != local.options.conf.hostname || typeof(local.req.headers[':authority']) != 'undefined' && local.options.conf.server.scheme +'://'+ local.req.headers[':authority'] != local.options.conf.hostname ) ? true : false;
2019
- var hostname = (isProxyHost) ? ctx.config.envConf[bundle][env].hostname.replace(/\:\d+$/, '') : ctx.config.envConf[bundle][env].hostname;
2263
+ var localRequestPort = local.req.headers.port || local.req.headers[':port'];
2264
+ var isProxyHost = (
2265
+ typeof(local.req.headers.host) != 'undefined'
2266
+ && typeof(localRequestPort) != 'undefined'
2267
+ && /^(80|443)$/.test(localRequestPort)
2268
+ && local.options.conf.server.scheme +'://'+ local.req.headers.host +':'+ localRequestPort != local.options.conf.hostname.replace(/\:\d+$/, '') +':'+ local.options.conf.server.port
2269
+ ||
2270
+ typeof(local.req.headers[':authority']) != 'undefined'
2271
+ && local.options.conf.server.scheme +'://'+ local.req.headers[':authority'] != local.options.conf.hostname
2272
+ ||
2273
+ typeof(local.req.headers.host) != 'undefined'
2274
+ && typeof(localRequestPort) != 'undefined'
2275
+ && /^(80|443)$/.test(localRequestPort)
2276
+ && req.headers.host == local.options.conf.host
2277
+ ||
2278
+ typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
2279
+ && /^true$/i.test(local.req.headers['x-nginx-proxy'])
2280
+ ||
2281
+ typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
2282
+ ) ? true : false;
2283
+
2284
+
2285
+
2286
+ var hostname = (isProxyHost)
2287
+ ? process.gina.PROXY_HOSTNAME
2288
+ : ctx.config.envConf[bundle][env].hostname;
2289
+
2290
+ // var hostname = (isProxyHost)
2291
+ // ? ctx.config.envConf._proxyHostname
2292
+ // : ctx.config.envConf[bundle][env].hostname;
2293
+
2020
2294
 
2021
2295
  // if ( !/\:\d+$/.test(req.headers.host) )
2022
2296
  // hostname = hostname.replace(/\:\d+$/, '');
@@ -2078,7 +2352,7 @@ function SuperController(options) {
2078
2352
  originalMethod && !/GET/i.test(originalMethod)
2079
2353
  ) { // trying to redirect using the wrong method ?
2080
2354
 
2081
- console.warn(new Error('Your are trying to redirect using the wrong method: `'+ req.method+'`.\nThis can often occur while redirecting from a controller to another controller or from a bundle to another.\nA redirection is not permitted in this scenario.\nD\'ont panic :)\nSwitching request method to `GET` method instead.\n').message);
2355
+ console.warn(new Error('Your are trying to redirect using the wrong method: `'+ req.method+'`.\nThis can often occur while redirecting from a controller to another controller or from a bundle to another.\nA redirection is not permitted in this scenario.\nDon\'t panic :)\nSwitching request method to `GET` method instead.\n').message);
2082
2356
  method = local.req.method = self.setRequestMethod('GET', conf);
2083
2357
  code = 303;
2084
2358
  }
@@ -2750,9 +3024,10 @@ function SuperController(options) {
2750
3024
  }
2751
3025
  }
2752
3026
 
2753
- var ctx = getContext()
2754
- , protocol = null
2755
- , scheme = null
3027
+ var ctx = getContext()
3028
+ , protocol = null
3029
+ , scheme = null
3030
+ , isProxyHost = getContext('isProxyHost')
2756
3031
  ;
2757
3032
  // cleanup options.path
2758
3033
  if (/\:\/\//.test(options.path)) {
@@ -2785,6 +3060,7 @@ function SuperController(options) {
2785
3060
  var bundle = ( options.hostname.replace(/(.*)\:\/\//, '') ).split(/\@/)[0];
2786
3061
 
2787
3062
  // No shorcut possible because conf.hostname might differ from user inputs
3063
+
2788
3064
  options.host = ctx.gina.config.envConf[bundle][ctx.env].host.replace(/(.*)\:\/\//, '').replace(/\:\d+/, '');
2789
3065
  options.hostname = ctx.gina.config.envConf[bundle][ctx.env].hostname;
2790
3066
  options.port = ctx.gina.config.envConf[bundle][ctx.env].server.port;
@@ -2797,6 +3073,14 @@ function SuperController(options) {
2797
3073
  options.ca = ctx.gina.config.envConf[bundle][ctx.env].server.credentials.ca;
2798
3074
  }
2799
3075
 
3076
+ // if (
3077
+ // /^true$/i.test(isProxyHost)
3078
+ // && typeof(options.hostname) != 'undefined'
3079
+ // ) {
3080
+ // options.hostname = process.gina.PROXY_HOSTNAME;
3081
+ // options.host = process.gina.PROXY_HOST;
3082
+ // options.port = process.gina.PROXY_PORT;
3083
+ // }
2800
3084
  // might be != from the bundle requesting
2801
3085
  //options.protocol = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.protocol || ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
2802
3086
  //options.scheme = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.scheme || ctx.gina.config.envConf[bundle][ctx.env].server.scheme;
@@ -2842,6 +3126,33 @@ function SuperController(options) {
2842
3126
 
2843
3127
  }
2844
3128
 
3129
+ var handleHTTP1ClientRequestv2 = function (browser, options, callback) {
3130
+ var agent = new browser.Agent({ keepAlive: true });
3131
+ var options = {
3132
+ host: options.host,
3133
+ port: options.port,
3134
+ path: options.path,
3135
+ method: 'GET',
3136
+ agent: agent
3137
+ };
3138
+ var req = browser.request(options, function(res) {
3139
+ var str = "";
3140
+ var err = false;
3141
+ res.on('data', function (chunk) {
3142
+ str += chunk;
3143
+ });
3144
+ res.on('end', function () {
3145
+ // done
3146
+ return callback( err, data );
3147
+ });
3148
+ });
3149
+ req.write('');
3150
+ req.end();
3151
+ req.on('error', function(error) {
3152
+ err = error
3153
+ });
3154
+ };
3155
+
2845
3156
  var handleHTTP1ClientRequest = function(browser, options, callback) {
2846
3157
 
2847
3158
  var altOpt = JSON.clone(options);
@@ -3560,24 +3871,28 @@ function SuperController(options) {
3560
3871
  *
3561
3872
  * */
3562
3873
  this.getConfig = function(name) {
3874
+ var tmp = null;
3563
3875
  if ( typeof(name) != 'undefined' ) {
3564
3876
  try {
3565
- // needs to be read only
3566
- //config = JSON.clone(local.options.conf.content[name]);
3567
- //config = Object.freeze(local.options.conf.content[name]);
3568
- //Object.seal(local.options.conf.content[name]);
3569
- //Object.freeze(local.options.conf.content[name]);
3570
- // if ( self.isCacheless() ) {
3571
- // }
3572
- return JSON.clone(local.options.conf.content[name]);
3877
+ // Needs to be read only
3878
+ tmp = JSON.clone(local.options.conf.content[name]);
3573
3879
  } catch (err) {
3574
3880
  return undefined;
3575
3881
  }
3576
3882
  } else {
3577
- // config = JSON.stringify(local.options.conf);
3578
- // return JSON.parse(config)
3579
- return JSON.clone(local.options.conf);
3883
+ tmp = JSON.clone(local.options.conf);
3884
+ }
3885
+
3886
+ if (
3887
+ getContext('isProxyHost')
3888
+ && typeof(tmp.hostname) != 'undefined'
3889
+ ) {
3890
+ tmp.hostname = process.gina.PROXY_HOSTNAME;
3891
+ tmp.host = process.gina.PROXY_HOST;
3892
+ // tmp.hostname = getContext('gina').config.envConf._proxyHostname
3893
+ // tmp.host = tmp.hostname.replace(/^(https|http)\:\/\//, '');
3580
3894
  }
3895
+ return tmp;
3581
3896
  }
3582
3897
 
3583
3898
  /**
@@ -4390,7 +4705,7 @@ function SuperController(options) {
4390
4705
  return next();
4391
4706
  }
4392
4707
 
4393
- if ( /http\/2/.test(protocol) ) {
4708
+ if ( stream && /http\/2/.test(protocol) ) {
4394
4709
  return stream.end();
4395
4710
  }
4396
4711
 
@@ -0,0 +1,24 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [ master ]
7
+
8
+ jobs:
9
+ tests-linux:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ node-version: [10.16.0, 10.x, 12.x, 14.x, 16.x]
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Use Node.js ${{ matrix.node-version }}
18
+ uses: actions/setup-node@v1
19
+ with:
20
+ node-version: ${{ matrix.node-version }}
21
+ - name: Install module
22
+ run: npm install
23
+ - name: Run tests
24
+ run: npm test
@@ -0,0 +1,23 @@
1
+ name: lint
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [ master ]
7
+
8
+ env:
9
+ NODE_VERSION: 16.x
10
+
11
+ jobs:
12
+ lint-js:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+ - name: Use Node.js ${{ env.NODE_VERSION }}
17
+ uses: actions/setup-node@v1
18
+ with:
19
+ node-version: ${{ env.NODE_VERSION }}
20
+ - name: Install ESLint + ESLint configs/plugins
21
+ run: npm install --only=dev
22
+ - name: Lint files
23
+ run: npm run lint