Skip to content

Add the params in extended to the request URL#44

Merged
reedmclean merged 3 commits intomasterfrom
ExtraParams
Dec 17, 2018
Merged

Add the params in extended to the request URL#44
reedmclean merged 3 commits intomasterfrom
ExtraParams

Conversation

@reedmclean
Copy link
Copy Markdown
Contributor

extended was already a property on RemoteLRS with this intent, but it wasn't implemented yet. Now, if you want to append arbitrary parameters to the request URL, you can do so by setting values in the extended dictionary.

Also, I added default empty dictionaries to a few properties on RemoteLRS as a small usability improvement.

Copy link
Copy Markdown
Member

@brianjmiller brianjmiller left a comment

Choose a reason for hiding this comment

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

See comment, may need to discuss, otherwise I'm 👍 on this.

Comment thread TinCan/RemoteLRS.cs Outdated
if (req.queryParams != null)
String qs = "";
qs = AppendParamsToExistingQueryString(qs, req.queryParams);
qs = AppendParamsToExistingQueryString(qs, extended);
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.

This isn't necessarily wrong, but is a bit different behavior than how the original instance of this works. Specifically, in TinCanJS here, we only include the value from extended if it isn't in the passed in props. We should be cognizant of the difference and whether it is intentional. It seems the other libs don't yet have support for extended either, so what we do here sets a bit of a precedent.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That was not intentional. I will add the same logic that TinCanJS has.

@reedmclean reedmclean merged commit 48ffd42 into master Dec 17, 2018
@reedmclean reedmclean deleted the ExtraParams branch December 17, 2018 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants