Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

fix(http): add uri decoder for http_server #357

Merged
merged 27 commits into from
Dec 13, 2019

Conversation

levy5307
Copy link
Contributor

In http_server, there is no decoder to decode the encoded url which is received from front-end.
so, we can't get some special char, e.g., '#'.
for more detail: apache/incubator-pegasus#440

src/dist/http/url_decoder.h Outdated Show resolved Hide resolved
src/dist/http/test/url_decoder_test.cpp Outdated Show resolved Hide resolved
@neverchanje neverchanje changed the title fix: add url decoder for http_server fix(http): add url decoder for http_server Dec 12, 2019
@neverchanje neverchanje added the component/http HTTP/RESTful support label Dec 12, 2019
@levy5307 levy5307 changed the title fix(http): add url decoder for http_server fix(http): add uri decoder for http_server Dec 12, 2019
@acelyc111
Copy link
Member

通过这种方式, 能通过浏览器发送包含#的请求吗?

@levy5307
Copy link
Contributor Author

通过这种方式, 能通过浏览器发送包含#的请求吗?

不可以,默认情况下#之后的部分浏览器都不会传送给服务端。所以需要前端对uri先做编码,然后发送给服务端,服务端再做解码。业内都是这么做

neverchanje
neverchanje previously approved these changes Dec 12, 2019
src/dist/http/uri_decoder.cpp Show resolved Hide resolved
src/dist/http/uri_decoder.cpp Outdated Show resolved Hide resolved
neverchanje
neverchanje previously approved these changes Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.12.2 component/http HTTP/RESTful support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants