Skip to content

Commit

Permalink
Don't add the ID to the get request, as it's not used.
Browse files Browse the repository at this point in the history
* Instead put in the GET header, along with x-url
* Update the servers/README to indicate that
  • Loading branch information
stsquad committed Mar 12, 2010
1 parent f34abef commit 3ba8097
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions servers/README
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ CMD is the command to the edit server, it may be one of the following:

* edit

Optional parameters: ?id=${ID}&url=${URL}

The edit command is sent as an HTTP POST request. After the headers
the data is the current contents of the text area.

Once the edit is complete the server sends an HTTP 200 (OK) response
with the data containing the new text area text. Any other response
will result in the text area not being updated.

The optional URL allows the edit server to create more identifiable
names for the buffers/temp files to help the user keep track.
The extension also sets some headers which may be used by the edit
servers to create more identifiable names for the buffers/temp files
to help the user keep track.

x-url: The URL of the source page
textid: The unique (on the page) ID of the text area

* status

Expand Down
3 changes: 2 additions & 1 deletion xmlcomms.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function handleContentMessages(msg, tab_port)
var text = msg.text;

var xhr = new XMLHttpRequest();
var url = getEditUrl() + cmd + "/" + id;
var url = getEditUrl() + cmd;

console.log(" page URL:"+tab_port.tab.url);
console.log(" tab_port:"+tab_port.portId_);
Expand Down Expand Up @@ -101,6 +101,7 @@ function handleContentMessages(msg, tab_port)

xhr.setRequestHeader("Content-type", "text/plain");
xhr.setRequestHeader("x-url", tab_port.tab.url);
xhr.setRequestHeader("textid", id);
xhr.send(text);
}

Expand Down

0 comments on commit 3ba8097

Please sign in to comment.