Bug 289647

Summary: Default text engine 'kde' fails when pasting text longer than 513/741 characters
Product: [Unmaintained] plasma4 Reporter: Elias Probst <mail>
Component: widget-pastebinAssignee: Thomas Georgiou <TAGeorgiou>
Status: RESOLVED FIXED    
Severity: normal CC: adaptee, asouza, dariocambie
Priority: NOR Keywords: junior-jobs
Version: 4.7.90   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In: 4.11.0
Sentry Crash Report:

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