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 URL encoded form data binding #1800

Merged
merged 6 commits into from
Oct 24, 2023
Merged

Fix URL encoded form data binding #1800

merged 6 commits into from
Oct 24, 2023

Conversation

TharmiganK
Copy link
Contributor

@TharmiganK TharmiganK commented Oct 23, 2023

Purpose

$Subject

Fixes: ballerina-platform/ballerina-library#5068

Examples

import ballerina/http;
import ballerina/io;

service on new http:Listener(9090) {

    resource function post [string... path](map<string> form) returns map<string> {
        return form;
    }
}
$ curl -v "http://localhost:9090/test" -d "key0%261%3D2=value1&key2=value2%26value3%3Dvalue4"
*   Trying 127.0.0.1:9090...
* Connected to localhost (127.0.0.1) port 9090 (#0)
> POST /test HTTP/1.1
> Host: localhost:9090
> User-Agent: curl/8.1.2
> Accept: */*
> Content-Length: 49
> Content-Type: application/x-www-form-urlencoded
> 
< HTTP/1.1 201 Created
< content-type: application/json
< content-length: 52
< server: ballerina
< date: Mon, 23 Oct 2023 08:58:20 +0530
< 
* Connection #0 to host localhost left intact
{"key2":"value2&value3=value4", "key0&1=2":"value1"}

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (c6fa38d) 81.66% compared to head (1a39546) 81.66%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1800   +/-   ##
=========================================
  Coverage     81.66%   81.66%           
  Complexity      562      562           
=========================================
  Files           393      393           
  Lines         21343    21343           
  Branches       4780     4780           
=========================================
+ Hits          17429    17430    +1     
+ Misses         2928     2924    -4     
- Partials        986      989    +3     
Files Coverage Δ
...ture/converter/UrlEncodedStringToMapConverter.java 61.11% <50.00%> (-2.78%) ⬇️

... and 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TharmiganK TharmiganK added the Skip GraalVM Check This will skip the GraalVM compatibility check label Oct 24, 2023
@sonarcloud
Copy link

sonarcloud bot commented Oct 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@TharmiganK TharmiganK merged commit 52122f9 into master Oct 24, 2023
7 of 10 checks passed
@TharmiganK TharmiganK deleted the fix-url-encode branch October 24, 2023 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip GraalVM Check This will skip the GraalVM compatibility check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URL encoded form data binding is failing
2 participants