Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify logic of REST request suffix parsing. #6648

Merged
merged 1 commit into from Sep 8, 2015

Conversation

@domob1812
Copy link
Contributor

domob1812 commented Sep 7, 2015

This patch changes the way the suffix (giving the requested data format) is parsed for REST requests. Before, the string was split at '.' characters and it was assumed that the second part was the suffix.

Now, we look for the last dot and use that to determine the suffix. This allows for strings that contain dots (not used now, though), and seems, in general, to be clearer and more intuitive.

This patch changes the way the suffix (giving the requested data format) is
parsed for REST requests.  Before, the string was split at '.'
characters and it was assumed that the second part was the suffix.

Now, we look for the last dot and use that to determine the suffix.
This allows for strings that contain dots (not used now, though), and
seems, in general, to be clearer and more intuitive.
@jgarzik
Copy link
Contributor

jgarzik commented Sep 7, 2015

ut ACK - I like it

@sipa
Copy link
Member

sipa commented Sep 7, 2015

utACK

1 similar comment
@dcousens
Copy link
Contributor

dcousens commented Sep 8, 2015

utACK

@jonasschnelli
Copy link
Member

jonasschnelli commented Sep 8, 2015

Definitively cleaner.
utACK.

@laanwj
Copy link
Member

laanwj commented Sep 8, 2015

Looks good to me.
utACK (but the tests cover this).

@laanwj laanwj added the RPC/REST/ZMQ label Sep 8, 2015
}

param = strReq.substr(0, pos);
const std::string suff(strReq, pos + 1);

This comment has been minimized.

Copy link
@laanwj

laanwj Sep 8, 2015

Member

Didn't even know std::string had a substring constructor. Nice.

@laanwj laanwj merged commit 9cdc335 into bitcoin:master Sep 8, 2015
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Sep 8, 2015
9cdc335 Simplify logic of REST request suffix parsing. (Daniel Kraft)
@domob1812 domob1812 deleted the domob1812:rest-param branch Sep 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.