{"id":43636410,"url":"https://github.com/rigon/hapi-url","last_synced_at":"2026-02-04T17:34:14.738Z","repository":{"id":57261142,"uuid":"126405743","full_name":"rigon/hapi-url","owner":"rigon","description":"URL resolver for Hapi.js","archived":false,"fork":false,"pushed_at":"2019-01-14T14:32:15.000Z","size":14,"stargazers_count":4,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-07T19:46:20.048Z","etag":null,"topics":["hapi","hapijs","resolver","url"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/hapi-url","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rigon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-22T23:14:24.000Z","updated_at":"2023-03-05T04:26:37.000Z","dependencies_parsed_at":"2022-09-13T03:30:53.764Z","dependency_job_id":null,"html_url":"https://github.com/rigon/hapi-url","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rigon/hapi-url","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigon%2Fhapi-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigon%2Fhapi-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigon%2Fhapi-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigon%2Fhapi-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rigon","download_url":"https://codeload.github.com/rigon/hapi-url/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rigon%2Fhapi-url/sbom","scorecard":{"id":776328,"data":{"date":"2025-08-11","repo":{"name":"github.com/rigon/hapi-url","commit":"89ecb62560ffa6f895ae61a4e940d4a3e3588932"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-mg85-8mv5-ffjr","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-rq8g-5pc5-wrhr","Warn: Project is vulnerable to: GHSA-7hx8-2rxv-66xv","Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-2mvq-xp48-4c77","Warn: Project is vulnerable to: GHSA-5854-jvxx-2cg9","Warn: Project is vulnerable to: GHSA-g64q-3vg8-8f93"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T03:43:40.291Z","repository_id":57261142,"created_at":"2025-08-23T03:43:40.291Z","updated_at":"2025-08-23T03:43:40.291Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29091945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-04T03:31:03.593Z","status":"ssl_error","status_checked_at":"2026-02-04T03:29:50.742Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hapi","hapijs","resolver","url"],"created_at":"2026-02-04T17:34:13.316Z","updated_at":"2026-02-04T17:34:14.733Z","avatar_url":"https://github.com/rigon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hapi.js URL resolver\n\nURL resolver for [Hapi.js](https://hapijs.com/)\n\n## How to use\n\nReturns an [URL object](https://www.npmjs.com/package/url) representing the current server's URL:\n\n```javascript\nconst HapiUrl = require('hapi-url');\nconsole.log(HapiUrl(request));\nconsole.log(HapiUrl(request).format());\nconsole.log(HapiUrl(request).resolve(\"/path\"));\n```\n\nOr, you can also write as:\n\n```javascript\nconst HapiUrl = require('hapi-url');\nconsole.log(HapiUrl.current(request));\nconsole.log(HapiUrl.resolve(request, \"/path\"));\n```\n\n`hapi-url` looks for `x-forwarded-proto` and `x-forwarded-host` to resolve the current URL correctly when behind a reverse proxy. \n\nIf `hapi-url` is not clever enought for your case, you can override the `protocol`, `host` and `basePath`. `basePath` can be used to resolve the URL when the proxy adds a prefix in the path:\n\n```javascript\nconst HapiUrl = require('hapi-url');\nHapi.init({\n    protocol: \"https\",\n    host: \"hiddenproxy.example.com\",\n    basePath: \"/proxy/path/\"\n})\nconsole.log(HapiUrl.format(request));\n```\n\n## Example\n\n```javascript\nconst Hapi = require('hapi');\nconst HapiUrl = require('hapi-url');\n\nconst server = new Hapi.Server({port: 3000});\n\nserver.route({\n    method: 'GET',\n    path: '/{path*}', // match some path\n    handler: function(request, h) {\n        return h.response(HapiUrl.current(request));    // reply with current URL\n    }\n});\n\nserver.start();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigon%2Fhapi-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frigon%2Fhapi-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frigon%2Fhapi-url/lists"}