Bug 289647 - Default text engine 'kde' fails when pasting text longer than 513/741 characters
Summary: Default text engine 'kde' fails when pasting text longer than 513/741 characters
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Unmaintained
Component: widget-pastebin (show other bugs)
Version: 4.7.90
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Georgiou
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2011-12-23 08:21 UTC by Elias Probst
Modified: 2013-04-10 13:52 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.11.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2011-12-23 08:21:05 UTC
Version:           unspecified (using Devel) 
OS:                Linux

When pasting text, longer than 513 characters (URL-encoded 741) using the default engine 'kde' (paste.kde.org), the upload will fail.

Reproducible: Always

Steps to Reproduce:
1. Copy the following text (it ends in a whitespace)
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is 

2. Paste it using the 'kde' engine to the pastebin applet
3. It works
4. Add a single character to the previous text, so copy the following text:
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a text which is just there to test a bug in the pastebin applet
This is a

4. Paste it using the 'kde' engine to the pastebin applet

Actual Results:  
3. works
4. doesn't work

Expected Results:  
3. works
4. works

Although the error is caused by the application running on paste.kde.org, I believe this could be solved in the shareprovider engine. It currently uses GET as submit method, while the form on paste.kde.org uses POST to submit the data.

Using:
KDE 4.7.90 (4.8.0 beta2)
Qt 4.7.4
Comment 1 Artur Souza (MoRpHeUz) 2012-01-03 13:42:11 UTC
Hello,

Thanks for reporting! The 'GET' shouldn't be a problem as it's supported by the API: http://paste.kde.org/doc/api/

Other backends work well with the same text. Interesting. I'll investigate but it would be good if you could take a look too as I'm a little bit out of time.

Thanks!
Comment 2 Artur Souza (MoRpHeUz) 2012-01-03 14:52:41 UTC
This is a good junior job for someone looking into starting kde development :)
Comment 3 Dario Cambié 2012-08-04 10:31:59 UTC
The problem is indeed the GET method (probably the URL becomes too long?) since changing

function method() {
    return "GET";
}

to

function method() {
    return "POST";
}


in kde/kde-workspace/plasma/generic/dataengines/share/backends/kde/contents/code/main.js make the plasmoid works with long text (cfr. http://paste.kde.org/528422/)
Comment 4 Chao Feng 2013-04-10 13:52:29 UTC
Git commit a7d0ef49cb7839d42646334459f1140ed32c0a41 by Feng Chao.
Committed on 10/04/2013 at 15:44.
Pushed by fengchao into branch 'master'.

Fix Bug 289647 - Default text engine 'kde' fails when pasting text longer than 513/741 characters

Use "post" instead of "get" method for kde paste bin.
HTTP get method only support 1024 url length.
FIXED-IN: 4.11.0

M  +1    -1    plasma/generic/dataengines/share/backends/kde/contents/code/main.js

http://commits.kde.org/kde-workspace/a7d0ef49cb7839d42646334459f1140ed32c0a41