Skip to content

Simplify logic of REST request suffix parsing. - #6648

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
domob1812:rest-param
Sep 8, 2015
Merged

Simplify logic of REST request suffix parsing.#6648
laanwj merged 1 commit into
bitcoin:masterfrom
domob1812:rest-param

Conversation

@domob1812

Copy link
Copy Markdown
Contributor

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

jgarzik commented Sep 7, 2015

Copy link
Copy Markdown
Contributor

ut ACK - I like it

@sipa

sipa commented Sep 7, 2015

Copy link
Copy Markdown
Member

utACK

1 similar comment
@dcousens

dcousens commented Sep 8, 2015

Copy link
Copy Markdown
Contributor

utACK

@jonasschnelli

Copy link
Copy Markdown
Contributor

Definitively cleaner.
utACK.

@laanwj

laanwj commented Sep 8, 2015

Copy link
Copy Markdown
Member

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

Comment thread src/rest.cpp

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@laanwj
laanwj merged commit 9cdc335 into bitcoin:master Sep 8, 2015
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 rest-param branch September 8, 2015 14:23
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants