gina 0.1.6-alpha.8 → 0.1.6-alpha.80

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.80/VERSION +1 -0
  6. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/plugin/README.md +1 -0
  7. package/framework/v0.1.6-alpha.80/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +1 -0
  8. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/plugin/dist/vendor/gina/js/gina.js +369 -101
  9. package/framework/v0.1.6-alpha.80/core/asset/plugin/dist/vendor/gina/js/gina.min.js +776 -0
  10. package/framework/v0.1.6-alpha.80/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +8 -0
  11. package/framework/v0.1.6-alpha.80/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +8 -0
  12. package/framework/v0.1.6-alpha.80/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +8 -0
  13. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/config.js +117 -51
  14. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/lib/connector.v4.js +28 -22
  15. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/controller/controller.js +329 -56
  16. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/.github/workflows/ci.yml +24 -0
  17. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/.github/workflows/lint.yml +23 -0
  18. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/LICENSE +19 -0
  19. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/README.md +191 -0
  20. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-big.js +149 -0
  21. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/bench/bench-multipart-fields-100mb-small.js +143 -0
  22. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-big.js +154 -0
  23. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/bench/bench-multipart-files-100mb-small.js +148 -0
  24. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-100pairs-small.js +101 -0
  25. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/bench/bench-urlencoded-fields-900pairs-small-alt.js +84 -0
  26. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/lib/index.js +57 -0
  27. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/lib/types/multipart.js +680 -0
  28. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/lib/types/urlencoded.js +350 -0
  29. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/lib/utils.js +596 -0
  30. package/framework/v0.1.6-alpha.80/core/deps/busboy-1.6.0/package.json +22 -0
  31. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/gna.js +97 -18
  32. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/model/index.js +28 -24
  33. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/validator/src/form-validator.js +38 -26
  34. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/validator/src/main.js +254 -56
  35. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/router.js +75 -40
  36. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/server.isaac.js +46 -8
  37. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/server.js +31 -5
  38. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle/controllers/setup.js +2 -2
  39. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/conf/templates.json +4 -2
  40. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/context.js +16 -11
  41. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/path.js +25 -9
  42. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/add.js +2 -1
  43. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/start.js +21 -8
  44. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/build.js +1 -1
  45. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/init.js +18 -0
  46. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/link-node-modules.js +2 -3
  47. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/link.js +1 -0
  48. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/tail.js +28 -11
  49. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/version.js +15 -1
  50. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/helper.js +6 -2
  51. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/add.js +3 -2
  52. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/build.js +4 -4
  53. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/protocol/list.js +71 -50
  54. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/collection/src/main.js +8 -0
  55. package/framework/v0.1.6-alpha.80/lib/domain/exemples/backend.js +12 -0
  56. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/domain/src/main.js +3 -1
  57. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/merge/package.json +1 -1
  58. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/model.js +1 -1
  59. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/routing/src/main.js +58 -11
  60. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/session-store.js +2 -2
  61. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/swig-filters/src/main.js +64 -9
  62. package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/validator.js +2 -2
  63. package/framework/v0.1.6-alpha.80/package.json +12 -0
  64. package/package.json +2 -2
  65. package/utils/helper.js +24 -0
  66. package/framework/v0.1.6-alpha.8/VERSION +0 -1
  67. package/framework/v0.1.6-alpha.8/core/asset/plugin/dist/vendor/gina/css/gina.min.css.map +0 -1
  68. package/framework/v0.1.6-alpha.8/core/asset/plugin/dist/vendor/gina/js/gina.min.js +0 -766
  69. package/framework/v0.1.6-alpha.8/core/asset/plugin/dist/vendor/gina/js/gina.min.js.map +0 -8
  70. package/framework/v0.1.6-alpha.8/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js +0 -7
  71. package/framework/v0.1.6-alpha.8/core/asset/plugin/dist/vendor/gina/js/gina.onload.min.js.map +0 -8
  72. package/framework/v0.1.6-alpha.8/lib/domain/exemples/backend.js +0 -0
  73. package/framework/v0.1.6-alpha.8/package.json +0 -14
  74. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/AUTHORS +0 -0
  75. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/LICENSE +0 -0
  76. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/html/nolayout.html +0 -0
  77. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/html/static.html +0 -0
  78. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/img/android-chrome-192x192.png +0 -0
  79. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/img/android-chrome-512x512.png +0 -0
  80. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/img/apple-touch-icon.png +0 -0
  81. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/img/favicon-16x16.png +0 -0
  82. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/img/favicon-32x32.png +0 -0
  83. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/img/favicon.ico +0 -0
  84. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/plugin/dist/vendor/gina/css/gina.min.css +0 -0
  85. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/plugin/dist/vendor/gina/html/toolbar.html +0 -0
  86. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/asset/plugin/uuid.json +0 -0
  87. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/index.js +0 -0
  88. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/lib/connector.js +0 -0
  89. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  90. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  91. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/lib/n1ql.js +0 -0
  92. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/lib/session-store.js +0 -0
  93. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  94. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  95. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
  96. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/controller/controller.framework.js +0 -0
  97. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/controller/index.js +0 -0
  98. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/.travis.yml +0 -0
  99. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/LICENSE +0 -0
  100. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/README.md +0 -0
  101. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/deps/encoding/encoding-indexes.js +0 -0
  102. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/deps/encoding/encoding.js +0 -0
  103. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/lib/main.js +0 -0
  104. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/lib/types/multipart.js +0 -0
  105. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/lib/types/urlencoded.js +0 -0
  106. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/lib/utils.js +0 -0
  107. /package/framework/{v0.1.6-alpha.8/core/deps/busboy → v0.1.6-alpha.80/core/deps/busboy-0.2.14}/package.json +0 -0
  108. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  109. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/dev/index.js +0 -0
  110. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/dev/lib/class.js +0 -0
  111. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/dev/lib/factory.js +0 -0
  112. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/dev/lib/tools.js +0 -0
  113. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/README.md +0 -0
  114. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/currency.json +0 -0
  115. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/dist/language/en.json +0 -0
  116. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/dist/language/fr.json +0 -0
  117. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/dist/region/en.json +0 -0
  118. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/dist/region/fr.json +0 -0
  119. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/index.js +0 -0
  120. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/src/make.js +0 -0
  121. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/src/resources/currency.csv +0 -0
  122. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/src/resources/region.csv +0 -0
  123. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/locales/src/resources/region.mapping.json +0 -0
  124. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/mime.types +0 -0
  125. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/model/entity.js +0 -0
  126. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/model/template/entityFactory.js +0 -0
  127. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/model/template/index.js +0 -0
  128. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/README.md +0 -0
  129. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/index.js +0 -0
  130. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/file/README.md +0 -0
  131. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/file/build.json +0 -0
  132. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/file/package.json +0 -0
  133. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/intl/README.md +0 -0
  134. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/intl/build.json +0 -0
  135. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/intl/package.json +0 -0
  136. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/intl/src/main.js +0 -0
  137. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/storage/README.md +0 -0
  138. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/storage/build.json +0 -0
  139. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/storage/package.json +0 -0
  140. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/storage/src/main.js +0 -0
  141. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/validator/README.md +0 -0
  142. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/validator/build.json +0 -0
  143. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/plugins/lib/validator/package.json +0 -0
  144. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/server.express.js +0 -0
  145. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/status.codes +0 -0
  146. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/_gitignore +0 -0
  147. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle/config/app.json +0 -0
  148. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle/config/routing.json +0 -0
  149. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle/config/settings.json +0 -0
  150. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle/config/settings.server.json +0 -0
  151. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle/config/templates.json +0 -0
  152. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  153. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  154. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle/index.js +0 -0
  155. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  156. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  157. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  158. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  159. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  160. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_public/readme.md +0 -0
  161. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  162. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
  163. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
  164. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
  165. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
  166. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/command/gina.bat.tpl +0 -0
  167. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/command/gina.tpl +0 -0
  168. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/conf/env.json +0 -0
  169. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/conf/manifest.json +0 -0
  170. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/conf/package.json +0 -0
  171. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/conf/settings.json +0 -0
  172. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/conf/statics.json +0 -0
  173. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/error/client/json/401.json +0 -0
  174. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/error/client/json/403.json +0 -0
  175. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/error/client/json/404.json +0 -0
  176. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/error/server/html/50x.html +0 -0
  177. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/error/server/json/500.json +0 -0
  178. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/error/server/json/503.json +0 -0
  179. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/core/template/extensions/logger/config.json +0 -0
  180. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/console.js +0 -0
  181. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/data/LICENSE +0 -0
  182. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/data/README.md +0 -0
  183. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/data/package.json +0 -0
  184. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/data/src/main.js +0 -0
  185. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/dateFormat.js +0 -0
  186. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/index.js +0 -0
  187. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/json/LICENSE +0 -0
  188. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/json/README.md +0 -0
  189. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/json/package.json +0 -0
  190. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/json/src/main.js +0 -0
  191. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/plugins/README.md +0 -0
  192. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/plugins/package.json +0 -0
  193. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/plugins/src/api-error.js +0 -0
  194. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/plugins/src/main.js +0 -0
  195. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/prototypes.js +0 -0
  196. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/task.js +0 -0
  197. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/helpers/text.js +0 -0
  198. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/archiver/README.md +0 -0
  199. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/archiver/build.json +0 -0
  200. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/archiver/package.json +0 -0
  201. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/archiver/src/dep/jszip.min.js +0 -0
  202. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/archiver/src/main.js +0 -0
  203. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/aliases.json +0 -0
  204. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/arguments.json +0 -0
  205. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/copy.js +0 -0
  206. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/cp.js +0 -0
  207. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/help.js +0 -0
  208. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/help.txt +0 -0
  209. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/list.js +0 -0
  210. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/remove.js +0 -0
  211. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/rename.js +0 -0
  212. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/restart.js +0 -0
  213. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/rm.js +0 -0
  214. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/status.js +0 -0
  215. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/bundle/stop.js +0 -0
  216. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/add.js +0 -0
  217. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/get.js +0 -0
  218. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/help.js +0 -0
  219. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/help.txt +0 -0
  220. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/link-dev.js +0 -0
  221. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/list.js +0 -0
  222. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/remove.js +0 -0
  223. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/rm.js +0 -0
  224. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/set.js +0 -0
  225. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/unset.js +0 -0
  226. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/env/use.js +0 -0
  227. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/dot.js +0 -0
  228. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/get.js +0 -0
  229. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/help.js +0 -0
  230. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/help.txt +0 -0
  231. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/msg.json +0 -0
  232. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/open.js +0 -0
  233. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/restart.js +0 -0
  234. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/set.js +0 -0
  235. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/start.js +0 -0
  236. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/status.js +0 -0
  237. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/stop.js +0 -0
  238. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/framework/update.js +0 -0
  239. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/gina-dev.1.md +0 -0
  240. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/gina-framework.1.md +0 -0
  241. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/gina.1.md +0 -0
  242. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/index.js +0 -0
  243. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/msg.json +0 -0
  244. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/port/help.js +0 -0
  245. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/port/help.txt +0 -0
  246. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/port/inc/scan.js +0 -0
  247. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/port/list.js +0 -0
  248. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/port/reset.js +0 -0
  249. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/port/set.js +0 -0
  250. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/arguments.json +0 -0
  251. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/help.js +0 -0
  252. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/help.txt +0 -0
  253. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/import.js +0 -0
  254. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/list.js +0 -0
  255. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/move.js +0 -0
  256. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/remove.js +0 -0
  257. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/rename.js +0 -0
  258. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/restart.js +0 -0
  259. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/rm.js +0 -0
  260. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/start.js +0 -0
  261. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/status.js +0 -0
  262. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/project/stop.js +0 -0
  263. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/protocol/help.js +0 -0
  264. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/protocol/help.txt +0 -0
  265. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/protocol/set.js +0 -0
  266. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/scope/add.js +0 -0
  267. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/scope/help.js +0 -0
  268. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/scope/help.txt +0 -0
  269. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/scope/link-local.js +0 -0
  270. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/scope/link-production.js +0 -0
  271. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/scope/list.js +0 -0
  272. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/scope/remove.js +0 -0
  273. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/scope/rm.js +0 -0
  274. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/scope/use.js +0 -0
  275. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cmd/view/add.js +0 -0
  276. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/collection/README.md +0 -0
  277. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/collection/build.json +0 -0
  278. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/collection/package.json +0 -0
  279. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/config.js +0 -0
  280. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cron/README.md +0 -0
  281. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cron/package.json +0 -0
  282. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/cron/src/main.js +0 -0
  283. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/domain/LICENSE +0 -0
  284. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/domain/README.md +0 -0
  285. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/domain/dist/public_suffix_list.dat +0 -0
  286. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/domain/exemples/frontend.html +0 -0
  287. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/domain/package.json +0 -0
  288. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/generator/index.js +0 -0
  289. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/index.js +0 -0
  290. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/inherits/LICENSE +0 -0
  291. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/inherits/README.md +0 -0
  292. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  293. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/inherits/example/protected_inheritance.js +0 -0
  294. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/inherits/example/simple_inheritance.js +0 -0
  295. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  296. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/inherits/package.json +0 -0
  297. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/inherits/src/main.js +0 -0
  298. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/README.md +0 -0
  299. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/package.json +0 -0
  300. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/src/containers/default/index.js +0 -0
  301. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/src/containers/file/index.js +0 -0
  302. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  303. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  304. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/src/containers/mq/index.js +0 -0
  305. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/src/containers/mq/listener.js +0 -0
  306. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/src/containers/mq/speaker.js +0 -0
  307. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/src/helper.js +0 -0
  308. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/logger/src/main.js +0 -0
  309. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/math/index.js +0 -0
  310. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/merge/README.md +0 -0
  311. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/merge/example/merge.js +0 -0
  312. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/merge/example/merge_2_literal objects.js +0 -0
  313. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/merge/example/merge_and_preserve_first.js +0 -0
  314. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/merge/src/main.js +0 -0
  315. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/proc.js +0 -0
  316. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/routing/README.md +0 -0
  317. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/routing/build.json +0 -0
  318. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/routing/package.json +0 -0
  319. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/shell.js +0 -0
  320. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/swig-filters/README.md +0 -0
  321. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/swig-filters/package.json +0 -0
  322. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/url/README.md +0 -0
  323. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/url/index.js +0 -0
  324. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/url/mocks.json +0 -0
  325. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/url/routing.json +0 -0
  326. /package/framework/{v0.1.6-alpha.8 → v0.1.6-alpha.80}/lib/url/test.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;
425
+
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) ) {
346
449
 
347
- var routing = local.options.conf.routing = ctx.config.envConf.routing; // all routes
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,12 +956,28 @@ 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
+
848
981
  // setup swig default filters
849
982
  var filters = SwigFilters({
850
983
  options : JSON.clone(localOptions),
@@ -883,6 +1016,7 @@ function SuperController(options) {
883
1016
  , XHRData = null
884
1017
  , XHRView = null
885
1018
  , isDeferModeEnabled = null
1019
+ , hasExternalsPlugins = null
886
1020
  , viewInfos = null
887
1021
  , filename = null
888
1022
  , isWithSwigLayout = null
@@ -1023,6 +1157,7 @@ function SuperController(options) {
1023
1157
  // }
1024
1158
 
1025
1159
  isDeferModeEnabled = localOptions.template.javascriptsDeferEnabled || localOptions.conf.content.templates._common.javascriptsDeferEnabled || false;
1160
+ hasExternalsPlugins = (localOptions.template.externalPlugins.length > 0) ? true : false;
1026
1161
 
1027
1162
  // iframe case - without HTML TAG
1028
1163
  if (!self.isXMLRequest() && !/\<html/.test(layout) ) {
@@ -1124,10 +1259,18 @@ function SuperController(options) {
1124
1259
  if (isLoadingPartial) {
1125
1260
  layout += '\t{{ page.view.scripts }}';
1126
1261
  } else {
1262
+ // placed in the HEAD
1127
1263
  if ( isDeferModeEnabled ) {
1128
1264
  layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1129
- } else { // placed in the BODY
1265
+ }
1266
+ // placed in the BODY
1267
+ else {
1130
1268
  layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
1269
+ if (hasExternalsPlugins) {
1270
+ for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
1271
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
1272
+ }
1273
+ }
1131
1274
  }
1132
1275
  }
1133
1276
 
@@ -1173,6 +1316,11 @@ function SuperController(options) {
1173
1316
  // layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1174
1317
  // } else { // placed in the BODY
1175
1318
  // layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
1319
+ // if (hasExternalsPlugins) {
1320
+ // for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
1321
+ // layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
1322
+ // }
1323
+ // }
1176
1324
  // }
1177
1325
  // }
1178
1326
 
@@ -1189,11 +1337,18 @@ function SuperController(options) {
1189
1337
  layout += '\t'+ localOptions.template.ginaLoader +'\n';
1190
1338
  }
1191
1339
  } else {
1340
+ // placed in the HEAD
1192
1341
  if ( isDeferModeEnabled && /\<\/head\>/i.test(layout) ) { // placed in the HEAD
1193
1342
  layout = layout.replace(/\<\/head\>/i, '\t{{ page.view.scripts }}\n\t</head>');
1194
-
1195
- } else { // placed in the BODY
1343
+ }
1344
+ // placed in the BODY
1345
+ else {
1196
1346
  layout = layout.replace(/\<\/body\>/i, '\t{{ page.view.scripts }}\n</body>');
1347
+ if (hasExternalsPlugins) {
1348
+ for (let i =0, len = localOptions.template.externalPlugins.length; i<len; i++) {
1349
+ layout = layout.replace(/\<\/head\>/i, '\t'+ localOptions.template.externalPlugins +'\n</head>');
1350
+ }
1351
+ }
1197
1352
  }
1198
1353
  // ginaLoader cannot be deferred
1199
1354
  if ( !localOptions.template.javascriptsExcluded || localOptions.template.javascriptsExcluded != '**' ) {
@@ -1619,7 +1774,11 @@ function SuperController(options) {
1619
1774
  var authority = ( typeof(local.req.headers['x-forwarded-proto']) != 'undefined' ) ? local.req.headers['x-forwarded-proto'] : local.options.conf.server.scheme;
1620
1775
  authority += '://'+ local.req.headers.host;
1621
1776
  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 ) {
1777
+ if (
1778
+ !/^\/$/.test(local.options.conf.server.webroot)
1779
+ && local.options.conf.server.webroot.length > 0
1780
+ // && local.options.conf.hostname.replace(/\:\d+$/, '') == authority
1781
+ ) {
1623
1782
  useWebroot = true
1624
1783
  }
1625
1784
  authority = null;
@@ -1630,11 +1789,19 @@ function SuperController(options) {
1630
1789
 
1631
1790
  //Get css
1632
1791
  if( viewConf.stylesheets ) {
1633
- cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL)
1792
+ // cssStr = getNodeRes('css', viewConf.stylesheets, useWebroot, reURL);
1793
+ // Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
1794
+ var cssColl = new Collection(viewConf.stylesheets).orderBy({route: 'asc'})
1795
+ cssStr = getNodeRes('css', cssColl, useWebroot, reURL);
1796
+ cssColl = null;
1634
1797
  }
1635
1798
  //Get js
1636
1799
  if( viewConf.javascripts ) {
1637
- jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL)
1800
+ // jsStr = getNodeRes('js', viewConf.javascripts, useWebroot, reURL);
1801
+ // Fixed on 2025-03-08: ordered by route, making sure that _common could all be loaded first
1802
+ var jsColl = new Collection(viewConf.javascripts).orderBy({route: 'asc'})
1803
+ jsStr = getNodeRes('js', jsColl, useWebroot, reURL);
1804
+ jsColl = null;
1638
1805
  }
1639
1806
 
1640
1807
  set('page.view.stylesheets', cssStr);
@@ -1663,13 +1830,45 @@ function SuperController(options) {
1663
1830
  , rLen = resArr.length
1664
1831
  , obj = null
1665
1832
  , str = ''
1833
+ , isProxyHost = getContext('isProxyHost')
1666
1834
  , requestHost = ( /http\/2/.test(local.options.conf.server.protocol) )
1667
1835
  ? local.req.headers[':host']
1668
1836
  : local.req.headers.host
1669
1837
  , hostname = ( typeof(requestHost) != 'undefined' && local.options.conf.host != requestHost)
1670
- ? local.options.conf.server.scheme +'://'+ requestHost + ':'+ local.options.conf.server.port
1838
+ ? local.options.conf.server.scheme +'://'+ requestHost
1671
1839
  : local.options.conf.hostname
1840
+ , scheme = hostname.match(/^(https|http)/)[0]
1672
1841
  ;
1842
+ var requestPort = (local.req.headers.port||local.req.headers[':port']);
1843
+ var hostPort = local.options.conf.hostname.match(/(\:d+\/|\:\d+)$/);
1844
+ hostPort = (hostPort) ? ~~(hostPort[0].replace(/\:/g, '')) : local.options.conf.port[local.options.conf.server.protocol][local.options.conf.server.scheme];
1845
+ // Linking bundle B from bundle A wihtout proxy
1846
+ var isSpecialCase = (
1847
+ getContext('bundle') != local.options.conf.bundle
1848
+ && requestPort != hostPort
1849
+ && local.req.headers[':host'] != process.gina.PROXY_HOST
1850
+ ) ? true : false;
1851
+
1852
+ if (isSpecialCase) {
1853
+ hostname = local.options.conf.hostname
1854
+ }
1855
+
1856
+
1857
+ if (
1858
+ isProxyHost
1859
+ && !isSpecialCase
1860
+ ) {
1861
+
1862
+ hostname = scheme + '://'+ (local.req.headers.host||local.req.headers[':host']||process.gina.PROXY_HOST);
1863
+
1864
+ if (
1865
+ !/^(80|443)$/.test(requestPort)
1866
+ && !new RegExp(requestPort+'$').test(hostname)
1867
+ ) {
1868
+ hostname += ':'+ requestPort;
1869
+ }
1870
+ }
1871
+
1673
1872
  switch(type){
1674
1873
  case 'css':
1675
1874
  for (; r < rLen; ++r) {
@@ -1701,7 +1900,21 @@ function SuperController(options) {
1701
1900
  if (!/\:\/\//.test(obj.url) ) {
1702
1901
  obj.url = hostname + obj.url;
1703
1902
  }
1704
- str += '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>'
1903
+
1904
+
1905
+ if ( /\/jquery\.(.*)\.(min\.js|js)$/i.test(obj.url) ) {
1906
+ 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) +' .');
1907
+ }
1908
+ // Allow jQuery & other external plugins to be loaded in the HEAD section before gina
1909
+ if (
1910
+ obj.isExternalPlugin
1911
+ ) {
1912
+ local.options.template.externalPlugins.splice(1, 0, '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>');
1913
+ }
1914
+ else {
1915
+ // normal case
1916
+ str += '\n\t\t<script'+ deferMode +' type="'+ obj.type +'" src="'+ obj.url +'"></script>';
1917
+ }
1705
1918
  }
1706
1919
  break;
1707
1920
  }
@@ -1895,9 +2108,9 @@ function SuperController(options) {
1895
2108
  // ignoreWebRoot = false
1896
2109
  // } else
1897
2110
  if (typeof(res) === 'string' || typeof(res) === 'number' || typeof(res) === 'boolean') {
1898
- if ( /true|1/.test(res) ) {
2111
+ if ( /^(true|1)$/i.test(res) ) {
1899
2112
  ignoreWebRoot = true
1900
- } else if ( /false|0/.test(res) ) {
2113
+ } else if ( /^(false|0)$/i.test(res) ) {
1901
2114
  ignoreWebRoot = false
1902
2115
  } else {
1903
2116
  res = local.res;
@@ -2015,11 +2228,32 @@ function SuperController(options) {
2015
2228
 
2016
2229
  if ( !self.forward404Unless(condition, req, res) ) { // forward to 404 if bad route
2017
2230
 
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;
2231
+ var localRequestPort = local.req.headers.port || local.req.headers[':port'];
2232
+ var isProxyHost = (
2233
+ typeof(local.req.headers.host) != 'undefined'
2234
+ && typeof(localRequestPort) != 'undefined'
2235
+ && /^(80|443)$/.test(localRequestPort)
2236
+ && local.options.conf.server.scheme +'://'+ local.req.headers.host +':'+ localRequestPort != local.options.conf.hostname.replace(/\:\d+$/, '') +':'+ local.options.conf.server.port
2237
+ ||
2238
+ typeof(local.req.headers[':authority']) != 'undefined'
2239
+ && local.options.conf.server.scheme +'://'+ local.req.headers[':authority'] != local.options.conf.hostname
2240
+ ||
2241
+ typeof(local.req.headers.host) != 'undefined'
2242
+ && typeof(localRequestPort) != 'undefined'
2243
+ && /^(80|443)$/.test(localRequestPort)
2244
+ && req.headers.host == local.options.conf.host
2245
+ ||
2246
+ typeof(local.req.headers['x-nginx-proxy']) != 'undefined'
2247
+ && /^true$/i.test(local.req.headers['x-nginx-proxy'])
2248
+ ||
2249
+ typeof(process.gina.PROXY_HOSTNAME) != 'undefined'
2250
+ ) ? true : false;
2251
+
2252
+ // var isProxyHost = getContext('isProxyHost');
2253
+ var hostname = (isProxyHost)
2254
+ ? process.gina.PROXY_HOSTNAME
2255
+ : ctx.config.envConf[bundle][env].hostname;
2020
2256
 
2021
- // if ( !/\:\d+$/.test(req.headers.host) )
2022
- // hostname = hostname.replace(/\:\d+$/, '');
2023
2257
 
2024
2258
  if (route) { // will go with route first
2025
2259
 
@@ -2078,7 +2312,7 @@ function SuperController(options) {
2078
2312
  originalMethod && !/GET/i.test(originalMethod)
2079
2313
  ) { // trying to redirect using the wrong method ?
2080
2314
 
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);
2315
+ 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
2316
  method = local.req.method = self.setRequestMethod('GET', conf);
2083
2317
  code = 303;
2084
2318
  }
@@ -2659,7 +2893,8 @@ function SuperController(options) {
2659
2893
  ) {
2660
2894
  return false
2661
2895
  }
2662
- self.isProcessingError = false; // by default
2896
+ // by default
2897
+ self.isProcessingError = false;
2663
2898
 
2664
2899
  var queryData = {}
2665
2900
  , defaultOptions = local.query.options
@@ -2669,9 +2904,8 @@ function SuperController(options) {
2669
2904
 
2670
2905
  // options must be used as a copy in case of multiple calls of self.query(options, ...)
2671
2906
  options = merge(JSON.clone(options), defaultOptions);
2672
- // options = merge(options, defaultOptions);
2673
2907
 
2674
- for (var o in options) {//cleaning
2908
+ for (let o in options) {//cleaning
2675
2909
  if ( typeof(options[o]) == 'undefined' || options[o] == undefined) {
2676
2910
  delete options[o]
2677
2911
  }
@@ -2750,9 +2984,12 @@ function SuperController(options) {
2750
2984
  }
2751
2985
  }
2752
2986
 
2753
- var ctx = getContext()
2754
- , protocol = null
2755
- , scheme = null
2987
+ var ctx = getContext()
2988
+ , protocol = null
2989
+ , scheme = null
2990
+ , isProxyHost = getContext('isProxyHost')
2991
+ , bundle = null
2992
+ , webroot = options.webroot || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.webroot;// bundle servers's webroot by default
2756
2993
  ;
2757
2994
  // cleanup options.path
2758
2995
  if (/\:\/\//.test(options.path)) {
@@ -2774,6 +3011,7 @@ function SuperController(options) {
2774
3011
  protocol = protocol.match(/[.a-z 0-9]+/ig)[0];
2775
3012
  scheme = options.scheme || ctx.gina.config.envConf[ctx.bundle][ctx.env].server.scheme;// bundle servers's scheme by default
2776
3013
  scheme = scheme.match(/[a-z 0-9]+/ig)[0];
3014
+
2777
3015
  // retrieve credentials
2778
3016
  if ( typeof(options.ca) == 'undefined' || ! options.ca ) {
2779
3017
  options.ca = ctx.gina.config.envConf[ctx.bundle][ctx.env].server.credentials.ca;
@@ -2782,13 +3020,11 @@ function SuperController(options) {
2782
3020
  //retrieving dynamic host, hostname & port
2783
3021
  if ( /\@/.test(options.hostname) ) {
2784
3022
 
2785
- var bundle = ( options.hostname.replace(/(.*)\:\/\//, '') ).split(/\@/)[0];
2786
-
3023
+ bundle = ( options.hostname.replace(/(.*)\:\/\//, '') ).split(/\@/)[0];
2787
3024
  // No shorcut possible because conf.hostname might differ from user inputs
2788
3025
  options.host = ctx.gina.config.envConf[bundle][ctx.env].host.replace(/(.*)\:\/\//, '').replace(/\:\d+/, '');
2789
3026
  options.hostname = ctx.gina.config.envConf[bundle][ctx.env].hostname;
2790
3027
  options.port = ctx.gina.config.envConf[bundle][ctx.env].server.port;
2791
-
2792
3028
  options.protocol = ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
2793
3029
  options.scheme = ctx.gina.config.envConf[bundle][ctx.env].server.scheme;
2794
3030
 
@@ -2796,10 +3032,6 @@ function SuperController(options) {
2796
3032
  if ( typeof(options.ca) == 'undefined' || ! options.ca ) {
2797
3033
  options.ca = ctx.gina.config.envConf[bundle][ctx.env].server.credentials.ca;
2798
3034
  }
2799
-
2800
- // might be != from the bundle requesting
2801
- //options.protocol = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.protocol || ctx.gina.config.envConf[bundle][ctx.env].server.protocol;
2802
- //options.scheme = ctx.gina.config.envConf[bundle][ctx.env].content.settings.server.scheme || ctx.gina.config.envConf[bundle][ctx.env].server.scheme;
2803
3035
  }
2804
3036
 
2805
3037
  if ( typeof(options.protocol) == 'undefined' ) {
@@ -2813,8 +3045,16 @@ function SuperController(options) {
2813
3045
 
2814
3046
 
2815
3047
  // reformating scheme
2816
- if( !/\:$/.test(options.scheme) )
3048
+ if( !/\:$/.test(options.scheme) ) {
2817
3049
  options.scheme += ':';
3050
+ }
3051
+
3052
+ if (isProxyHost) {
3053
+ // X-Forwarded-Host
3054
+ options.headers['x-forwarded-host'] = process.gina.PROXY_HOST;
3055
+ // X-Forwarded-Proto
3056
+ options.headers['x-forwarded-proto'] = process.gina.PROXY_SCHEME;
3057
+ }
2818
3058
 
2819
3059
  try {
2820
3060
  options.queryData = queryData;
@@ -2826,6 +3066,8 @@ function SuperController(options) {
2826
3066
 
2827
3067
  browser = require(''+ httpLib);
2828
3068
 
3069
+ bundle = null;
3070
+
2829
3071
  if ( /http2/.test(httpLib) ) {
2830
3072
  return handleHTTP2ClientRequest(browser, options, callback);
2831
3073
  } else {
@@ -2839,9 +3081,36 @@ function SuperController(options) {
2839
3081
  }
2840
3082
  self.emit('query#complete', err)
2841
3083
  }
2842
-
2843
3084
  }
2844
3085
 
3086
+ var handleHTTP1ClientRequestv2 = function (browser, options, callback) {
3087
+ var agent = new browser.Agent({ keepAlive: true });
3088
+ var options = {
3089
+ host: options.host,
3090
+ port: options.port,
3091
+ path: options.path,
3092
+ method: 'GET',
3093
+ agent: agent
3094
+ };
3095
+
3096
+ var req = browser.request(options, function(res) {
3097
+ var str = "";
3098
+ var err = false;
3099
+ res.on('data', function (chunk) {
3100
+ str += chunk;
3101
+ });
3102
+ res.on('end', function () {
3103
+ // done
3104
+ return callback( err, data );
3105
+ });
3106
+ });
3107
+ req.write('');
3108
+ req.end();
3109
+ req.on('error', function(error) {
3110
+ err = error
3111
+ });
3112
+ };
3113
+
2845
3114
  var handleHTTP1ClientRequest = function(browser, options, callback) {
2846
3115
 
2847
3116
  var altOpt = JSON.clone(options);
@@ -3560,24 +3829,28 @@ function SuperController(options) {
3560
3829
  *
3561
3830
  * */
3562
3831
  this.getConfig = function(name) {
3832
+ var tmp = null;
3563
3833
  if ( typeof(name) != 'undefined' ) {
3564
3834
  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]);
3835
+ // Needs to be read only
3836
+ tmp = JSON.clone(local.options.conf.content[name]);
3573
3837
  } catch (err) {
3574
3838
  return undefined;
3575
3839
  }
3576
3840
  } else {
3577
- // config = JSON.stringify(local.options.conf);
3578
- // return JSON.parse(config)
3579
- return JSON.clone(local.options.conf);
3841
+ tmp = JSON.clone(local.options.conf);
3842
+ }
3843
+
3844
+ if (
3845
+ getContext('isProxyHost')
3846
+ && typeof(tmp.hostname) != 'undefined'
3847
+ ) {
3848
+ tmp.hostname = process.gina.PROXY_HOSTNAME;
3849
+ tmp.host = process.gina.PROXY_HOST;
3850
+ // tmp.hostname = getContext('gina').config.envConf._proxyHostname
3851
+ // tmp.host = tmp.hostname.replace(/^(https|http)\:\/\//, '');
3580
3852
  }
3853
+ return tmp;
3581
3854
  }
3582
3855
 
3583
3856
  /**
@@ -4390,7 +4663,7 @@ function SuperController(options) {
4390
4663
  return next();
4391
4664
  }
4392
4665
 
4393
- if ( /http\/2/.test(protocol) ) {
4666
+ if ( stream && /http\/2/.test(protocol) ) {
4394
4667
  return stream.end();
4395
4668
  }
4396
4669
 
@@ -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