{"id":13776266,"url":"https://github.com/3scale/lua-resty-url","last_synced_at":"2025-12-30T01:49:57.826Z","repository":{"id":150318792,"uuid":"96202770","full_name":"3scale/lua-resty-url","owner":"3scale","description":"OpenResty library for parsing URI","archived":false,"fork":false,"pushed_at":"2022-10-03T05:56:13.000Z","size":51,"stargazers_count":43,"open_issues_count":3,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-02-13T21:48:08.324Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3scale.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-07-04T09:49:23.000Z","updated_at":"2023-10-31T18:23:10.000Z","dependencies_parsed_at":"2023-04-04T12:46:54.269Z","dependency_job_id":null,"html_url":"https://github.com/3scale/lua-resty-url","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3scale%2Flua-resty-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3scale%2Flua-resty-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3scale%2Flua-resty-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3scale%2Flua-resty-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3scale","download_url":"https://codeload.github.com/3scale/lua-resty-url/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253551495,"owners_count":21926303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-03T18:00:21.324Z","updated_at":"2025-12-30T01:49:57.786Z","avatar_url":"https://github.com/3scale.png","language":"Lua","funding_links":[],"categories":["Libraries","Lua"],"sub_categories":[],"readme":"lua-resty-url [![CircleCI](https://circleci.com/gh/3scale/lua-resty-url.svg?style=svg)](https://circleci.com/gh/3scale/lua-resty-url)\n====\n\nlua-resty-url - URL parser for OpenResty.\n\n\nTable of Contents\n=================\n\n* [Name](#name)\n* [Status](#status)\n* [Description](#description)\n* [Synopsis](#synopsis)\n* [Methods](#methods)\n    * [get](#get)\n    * [set](#set)\n    * [value](#value)\n    * [enabled](#enabled)\n    * [reset](#reset)\n* [Installation](#installation)\n* [TODO](#todo)\n* [Community](#community)\n* [Bugs and Patches](#bugs-and-patches)\n* [Author](#author)\n* [Copyright and License](#copyright-and-license)\n* [See Also](#see-also)\n\nStatus\n======\n\nThis library is considered production ready.\n\nDescription\n===========\n\nThis Lua library is very simple Regex based URL parser.\n\nThis library can parse URLs and split them to components. \n\nSynopsis\n========\n\n```lua\nhttp {\n    server {\n        location /test {\n            content_by_lua_block {\n                local resty_url = require 'resty.url'\n\n                ngx.say(\"USER: \", resty_url.parse('http://foo:bar@example.com').user)\n            }\n        }\n    }\n}\n```\n\n[Back to TOC](#table-of-contents)\n\nMethods\n=======\n\nAll the methods are expected to be called on the module without self.\n\n[Back to TOC](#table-of-contents)\n\nsplit\n---\n`syntax: parts = resty_url.split(url)`\n\nReturns a table with integer keys and parts of the URL.\nComponents are: scheme, user, password, host, port, path.\n\n[Back to TOC](#table-of-contents)\n\nparse\n-------\n`syntax: uri = resty_url.parse(url)`\n\nReturns a table with components as keys.\nComponents are: scheme, user, password, host, port, path.\n\n[Back to TOC](#table-of-contents)\n\njoin\n----------\n`syntax: url = resty_url.join(base, part, ...)`\n\nConcatenates URI components into resulting URL. Also normalizes URI to remove double slashes.\nCan concatenate objects returned by `parse` method.\n\n[Back to TOC](#table-of-contents)\n\ndefault\\_port\n------------\n`syntax: port = resty_url.default_port(scheme)`\n\nReturns default port for given scheme. Only http and https provided by default.\n\n[Back to TOC](#table-of-contents)\n\nnormalize\n------------\n`syntax: uri = resty_url.normalize(uri)`\n\nRemoves unnecessary slashes from the URI.\n\n[Back to TOC](#table-of-contents)\n\nInstallation\n============\n\nIf you are using the OpenResty bundle (http://openresty.org ), then\nyou can use [opm](https://github.com/openresty/opm#synopsis) to install this package.\n\n```shell\nopm get 3scale/lua-resty-url\n```\n\n[Back to TOC](#table-of-contents)\n\nBugs and Patches\n================\n\nPlease report bugs or submit patches by\n\n1. creating a ticket on the [GitHub Issue Tracker](http://github.com/3scale/lua-resty-url/issues),\n\n[Back to TOC](#table-of-contents)\n\nAuthor\n======\n\nMichal \"mikz\" Cichra \u003cmcichra@redhat.com\u003e, Red Hat Inc.\n\n[Back to TOC](#table-of-contents)\n\nCopyright and License\n=====================\n\nThis module is licensed under the Apache License Version 2.0.\n\nCopyright (C) 2016-2017, Red Hat Inc.\n\nAll rights reserved.\n\nSee [LICENSE](LICENSE) for the full license.\n\n[Back to TOC](#table-of-contents)\n\nSee Also\n========\n* the APIcast API Gateway: https://github.com/3scale/apicast/#readme\n\n[Back to TOC](#table-of-contents)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3scale%2Flua-resty-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3scale%2Flua-resty-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3scale%2Flua-resty-url/lists"}