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

fix(stark-core): use custom encoder for URL query parameters #1132

Merged

Conversation

carlo-nomes
Copy link
Collaborator

@carlo-nomes carlo-nomes commented Feb 13, 2019

  • extracted convertMapIntoObject function to separate file
  • added convertStarkQueryParamsIntoHttpParams function to correctly handle params in the http module
  • extended HttpParameterCodec according to this solution
  • updated http.util.spec.ts according to new implementation
  • test convertStarkQueryParamsIntoHttpParams

ISSUES CLOSED: #1130

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #1130

What is the new behavior?

Encodes special characters correctly

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Copy link
Collaborator

@christophercr christophercr left a comment

Choose a reason for hiding this comment

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

Small remarks

@coveralls
Copy link

coveralls commented Feb 13, 2019

Coverage Status

Coverage increased (+0.02%) to 92.948% when pulling b55ca8b on cnomes:fix/url-encode-plus into 505b4e1 on NationalBankBelgium:master.

@christophercr christophercr added this to the 10.0.0-beta.4 milestone Feb 13, 2019
@carlo-nomes carlo-nomes force-pushed the fix/url-encode-plus branch 2 times, most recently from 4986a51 to 8a96068 Compare February 13, 2019 14:49
@carlo-nomes
Copy link
Collaborator Author

@christophercr I updated the PR.

  - added `http-util` as util for http module
    - added `convertStarkQueryParamsIntoHttpParams` function to correctly handle params in the http module
    - test `http-util`
  - extracted `convertMapIntoObject` function to separate helper file
  - added `StarkHttpParameterCodec` as fix
    - see: angular/angular#18261 (comment)
  - updated tests in `http.service.spec.ts` according to new implementation

ISSUES CLOSED: NationalBankBelgium#1130
@christophercr christophercr changed the title fix(stark-core): encode url parameters fix(stark-core): use custom encoder for URL query parameters Feb 13, 2019
@christophercr christophercr merged commit a2bb6af into NationalBankBelgium:master Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

core: http - HttpClient does not encode '+' char properly (known bug)
3 participants