Libraryless. Click here for Pure Java version (11756L/70K).
1 | // 302 = "Moved temporarily" |
2 | static NanoHTTPD.Response serveRedirect(S url, S contentType default NanoHTTPD.MIME_PLAINTEXT) { |
3 | NanoHTTPD.IStatus status = new NanoHTTPD.IStatus() { |
4 | public String getDescription() { ret "302 Moved temporarily"; } |
5 | public int getRequestStatus() { ret 302; } |
6 | }; |
7 | |
8 | NanoHTTPD.Response r = NanoHTTPD.newFixedLengthResponse( |
9 | status, |
10 | contentType, ""); |
11 | r.addHeader("Location", url); |
12 | ret r; |
13 | } |
Began life as a copy of #1001852
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1004436 |
Snippet name: | serveRedirect |
Eternal ID of this version: | #1004436/2 |
Text MD5: | b3717a9323bb39c7ef275513895472b5 |
Transpilation MD5: | e2be679b722d320e5ee548e35970c1ab |
Author: | stefan |
Category: | |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-09-07 06:53:09 |
Source code size: | 451 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 545 / 606 |
Version history: | 1 change(s) |
Referenced in: | [show references] |