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

GHContent - Spaces in Path causes Malformed request #624

Closed
ope-nz opened this issue Nov 24, 2019 · 0 comments · Fixed by #625
Closed

GHContent - Spaces in Path causes Malformed request #624

ope-nz opened this issue Nov 24, 2019 · 0 comments · Fixed by #625
Labels

Comments

@ope-nz
Copy link

ope-nz commented Nov 24, 2019

Describe the bug
When using the GHContent update method and the path (filename) contains spaces the library throws an error of;

org.kohsuke.github.HttpException: <title>Malformed request</title>

We didn't receive a proper request from your browser. Please contact us if the problem persists.

To Reproduce
Steps to reproduce the behavior:

  1. Create any content in a file with spaces in the name eg Test Test.txt
  2. Try to update the file using GHContent update
  3. See error org.kohsuke.github.HttpException: <title>Malformed request</title>

Expected behavior
The file should be updated.

Desktop :

  • OS: Windows 10
  • Browser chrome
  • Version 1.99

Additional context
Create content has a the same issue but I can at least escape the file name with %20

@bitwiseman bitwiseman added the bug label Nov 25, 2019
bitwiseman added a commit to bitwiseman/github-api that referenced this issue Nov 26, 2019
bitwiseman added a commit to bitwiseman/github-api that referenced this issue Nov 26, 2019
URI path encoding whack-a-mole.  This fix should cover a significant number of cases.

Also, fixed to NOT do URLEncode for URI path.  The encoding is different between path and query.

Fixes hub4j#624
bitwiseman added a commit to bitwiseman/github-api that referenced this issue Nov 26, 2019
URI path encoding whack-a-mole.  This fix should cover a significant number of cases.

Also, fixed to NOT do URLEncode for URI path.  The encoding is different between path and query.

Fixes hub4j#624
bitwiseman added a commit to bitwiseman/github-api that referenced this issue Nov 26, 2019
URI path encoding whack-a-mole.  This fix should cover a significant number of cases.

Also, fixed to NOT do URLEncode for URI path.  The encoding is different between path and query.

Fixes hub4j#624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants