Title: Cannot register multiple endpoints · Issue #47 · etr/libhttpserver · GitHub
Open Graph Title: Cannot register multiple endpoints · Issue #47 · etr/libhttpserver
X Title: Cannot register multiple endpoints · Issue #47 · etr/libhttpserver
Description: Included is a test case to register multiple endpoints. This test fails. Is this a bug, or a misuse of the API? If this is bug, will you please confirm this is a valid test case, and I will continue diving into it. Thank you for your tim...
Open Graph Description: Included is a test case to register multiple endpoints. This test fails. Is this a bug, or a misuse of the API? If this is bug, will you please confirm this is a valid test case, and I will continu...
X Description: Included is a test case to register multiple endpoints. This test fails. Is this a bug, or a misuse of the API? If this is bug, will you please confirm this is a valid test case, and I will continu...
Opengraph URL: https://github.com/etr/libhttpserver/issues/47
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Cannot register multiple endpoints","articleBody":"Included is a test case to register multiple endpoints. This test fails. Is this a bug, or a misuse of the API? If this is bug, will you please confirm this is a valid test case, and I will continue diving into it. Thank you for your time.\n\nSincerely,\nJeremy Wright\n\n``` c++\nclass Ok_resource : public http_resource\u003cOk_resource\u003e\n{\n public:\n void render_GET(const http_request\u0026 req, http_response** res)\n {\n *res = new http_string_response(\"OK\", 200, \"text/plain\");\n }\n};\n\nclass Nok_resource : public http_resource\u003cNok_resource\u003e\n{\n public:\n void render_GET(const http_request\u0026 req, http_response** res)\n {\n *res = new http_string_response(\"NOK\", 200, \"text/plain\");\n }\n};\n\nLT_BEGIN_AUTO_TEST(basic_suite, two_endpoints)\n\n Ok_resource* ok = new Ok_resource();\n ws-\u003eregister_resource(\"OK\", ok);\n Nok_resource* nok = new Nok_resource();\n ws-\u003eregister_resource(\"NOK\", nok);\n\n curl_global_init(CURL_GLOBAL_ALL);\n std::string s;\n {\n CURL *curl = curl_easy_init();\n CURLcode res;\n curl_easy_setopt(curl, CURLOPT_URL, \"localhost:8080/OK\");\n curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);\n curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunc);\n curl_easy_setopt(curl, CURLOPT_WRITEDATA, \u0026s);\n res = curl_easy_perform(curl);\n LT_ASSERT_EQ(res, 0);\n LT_CHECK_EQ(s, \"OK\");\n curl_easy_cleanup(curl);\n }\n\n std::string t;\n { \n CURL *curl = curl_easy_init();\n CURLcode res;\n curl_easy_setopt(curl, CURLOPT_URL, \"localhost:8080/NOK\");\n curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);\n curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writefunc);\n curl_easy_setopt(curl, CURLOPT_WRITEDATA, \u0026t);\n res = curl_easy_perform(curl);\n LT_ASSERT_EQ(res, 0);\n LT_CHECK_EQ(t, \"NOK\");\n curl_easy_cleanup(curl);\n }\n\nLT_END_AUTO_TEST(two_endpoints)\n```\n","author":{"url":"https://github.com/JeremyLWright","@type":"Person","name":"JeremyLWright"},"datePublished":"2014-04-02T20:13:28.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/47/libhttpserver/issues/47"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f5059cfa-cb44-53e4-4358-34f77559c4bc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EDFC:8209F:4C77A:679F4:6964F360 |
| html-safe-nonce | df23a0dbaf1ce99e969f6f3930e1076473ebe276ce62356cbaaa134b366012fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFREZDOjgyMDlGOjRDNzdBOjY3OUY0OjY5NjRGMzYwIiwidmlzaXRvcl9pZCI6IjIxMDM0NTU1MTQ4MTUxNjUyODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 67a1493bc12d5f344028a360b68f2e1b9b1f3100ef594e3740d1bd48e9001ace |
| hovercard-subject-tag | issue:30721092 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/etr/libhttpserver/47/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f2a6b801056a332ec5cfd61013f14fe0ac0b0c758873a92e03a3f2e480da96e6/etr/libhttpserver/issues/47 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f2a6b801056a332ec5cfd61013f14fe0ac0b0c758873a92e03a3f2e480da96e6/etr/libhttpserver/issues/47 |
| og:image:alt | Included is a test case to register multiple endpoints. This test fails. Is this a bug, or a misuse of the API? If this is bug, will you please confirm this is a valid test case, and I will continu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | JeremyLWright |
| hostname | github.com |
| expected-hostname | github.com |
| None | 53cd8ae9b65b7c4a0ad545ffeb3216839259a92733857ba426906c0655c5419d |
| turbo-cache-control | no-preview |
| go-import | github.com/etr/libhttpserver git https://github.com/etr/libhttpserver.git |
| octolytics-dimension-user_id | 1201536 |
| octolytics-dimension-user_login | etr |
| octolytics-dimension-repository_id | 3416891 |
| octolytics-dimension-repository_nwo | etr/libhttpserver |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3416891 |
| octolytics-dimension-repository_network_root_nwo | etr/libhttpserver |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c140758368c0a01881f61b83770bd75cfe81e2c4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width